mirror of
https://github.com/ChristopherA/Learning-Bitcoin-from-the-Command-Line.git
synced 2025-06-08 08:26:17 +00:00
Update 5_2_Resending_a_Transaction_with_RBF.md
This commit is contained in:
parent
a33ceaadcc
commit
04abcc0f07
@ -8,9 +8,9 @@ If your Bitcoin transaction is stuck, and you're sender, you can resend it using
|
|||||||
|
|
||||||
## Opt-In for RBF
|
## Opt-In for RBF
|
||||||
|
|
||||||
RBF is an opt-in Bitcoin feature. Transactions are only eligible for using RBF if they've been created with a special RBF flag. This is done by setting a transaction's sequence number (which is typically set automatically), so that it's more than 0 and less than 0xffffffff-1 (4294967294).
|
RBF is an opt-in Bitcoin feature. Transactions are only eligible for using RBF if they've been created with a special RBF flag. This is done by setting a UTXO's sequence number (which is typically set automatically), so that it's more than 0 and less than 0xffffffff-1 (4294967294).
|
||||||
|
|
||||||
This is accomplished simply by adding a `sequence` variable to the `vins`:
|
This is accomplished simply by adding a `sequence` variable to your UTXO inputs:
|
||||||
```
|
```
|
||||||
$ rawtxhex=$(bitcoin-cli -named createrawtransaction inputs='''[ { "txid": "'$utxo_txid'", "vout": '$utxo_vout', "sequence": 1 } ]''' outputs='''{ "'$recipient'": 0.1, "'$changeaddress'": 0.9 }''')
|
$ rawtxhex=$(bitcoin-cli -named createrawtransaction inputs='''[ { "txid": "'$utxo_txid'", "vout": '$utxo_vout', "sequence": 1 } ]''' outputs='''{ "'$recipient'": 0.1, "'$changeaddress'": 0.9 }''')
|
||||||
```
|
```
|
||||||
@ -54,9 +54,9 @@ _Should I trust transactions with no confirmations?_ No, never. This was true be
|
|||||||
|
|
||||||
### Optional: Always Opt-In for RBF
|
### Optional: Always Opt-In for RBF
|
||||||
|
|
||||||
If you prefer, you can _always_ opt in for RBF. Do so by running your `bitcoind` with the `-walletrbf` command. Once you've done this (and restarted your `bitcoind`), then all transactions should have a lower sequence number and be marked as `bip125-replaceable`.
|
If you prefer, you can _always_ opt in for RBF. Do so by running your `bitcoind` with the `-walletrbf` command. Once you've done this (and restarted your `bitcoind`), then all UTXOs should have a lower sequence number and the transaction should be marked as `bip125-replaceable`.
|
||||||
|
|
||||||
Note the following example generated by `bitcoind`, which uses a sequence number of "1":
|
Note the following example generated by `bitcoind`, where the UTXO uses a sequence number of "1":
|
||||||
```
|
```
|
||||||
{
|
{
|
||||||
"txid": "d261b9494eb29084f668e1abd75d331fc2d6525dd206b2f5236753b5448ca12c",
|
"txid": "d261b9494eb29084f668e1abd75d331fc2d6525dd206b2f5236753b5448ca12c",
|
||||||
|
Loading…
x
Reference in New Issue
Block a user