Update 03_3__Interlude_Using_Command-Line_Variables.md

As explained in previous file of this book, if the "legacy" option is not used, the signature can't be made.

$ NEW_ADDRESS_1=$(bitcoin-cli getnewaddress)
$ echo $NEW_ADDRESS_1
2MxuvthTutriscciS5WkjixoMDneEizSwVW
$ NEW_SIG_1=$(bitcoin-cli signmessage $NEW_ADDRESS_1 "Hello World")
error code: -3
error message:
Address does not refer to key
This commit is contained in:
leonardo-sj 2020-05-15 22:10:32 -03:00 committed by GitHub
parent 0323d71d99
commit 7332ef2820
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -13,7 +13,7 @@ That's a simple command substitution, the equivalent to ``VARIABLE=`command` ``.
To create a new address would then look like this: To create a new address would then look like this:
``` ```
$ unset NEW_ADDRESS_1 $ unset NEW_ADDRESS_1
$ NEW_ADDRESS_1=$(bitcoin-cli getnewaddress) $ NEW_ADDRESS_1=$(bitcoin-cli getnewaddress "" legacy)
``` ```
These commands clear the NEW_ADDRESS_1 variable, just to be sure, then fill it with the results of the `bitcoin-cli getnewaddress` command. These commands clear the NEW_ADDRESS_1 variable, just to be sure, then fill it with the results of the `bitcoin-cli getnewaddress` command.