mirror of
https://github.com/ChristopherA/Learning-Bitcoin-from-the-Command-Line.git
synced 2025-06-07 16:06:26 +00:00
Update 3_4_Sending_a_Raw_Transaction_to_a_P2PKH.md
This commit is contained in:
parent
91b5dcb5e2
commit
bb27e6b785
@ -259,10 +259,12 @@ Our first raw transaction was very simplistic: we sent the entirety of a UTXO to
|
||||
|
||||
The solution is to create a change address:
|
||||
```
|
||||
$ changeaddress=$(bitcoin-cli getnewaddress)
|
||||
$ changeaddress=$(bitcoin-cli getrawchangeaddress)
|
||||
$ echo $changeaddress
|
||||
mxU9cmhJfkKWDtBspHaA36LkeafEDeaogJ
|
||||
```
|
||||
Note that this is a new function: `getrawchangeaddress`. It's largely the same as `getnewaddress` but is optimized for use as a change address in a raw transaction, so it doesn't do things like make entries in your address book.
|
||||
|
||||
You now have an additional address inside your wallet that you can use to receive change from a UTXO!
|
||||
|
||||
## Write a Raw Transaction with Two Outputs
|
||||
|
Loading…
x
Reference in New Issue
Block a user