[0.18] Backport #15911: Use wallet RBF default for walletcreatefundedpsbt #16608

pull Sjors wants to merge 3 commits into bitcoin:0.18 from Sjors:2018/08/backport-wallet-rbf-default changing 4 files +49 −25
  1. Sjors commented at 11:44 AM on August 14, 2019: member

    Backport of #15911 for 0.18 branch.

    The original PR changed rawtransaction_util.cpp, whereas the backport changes rawtransaction.cpp to avoid having to also backport #15638.

  2. fanquake added the label Backport on Aug 14, 2019
  3. fanquake added this to the milestone 0.18.2 on Aug 14, 2019
  4. fanquake added the label RPC/REST/ZMQ on Aug 14, 2019
  5. fanquake added the label Wallet on Aug 14, 2019
  6. meshcollider renamed this:
    [backport] Use wallet RBF default for walletcreatefundedpsbt
    [0.18] Backport: Use wallet RBF default for walletcreatefundedpsbt
    on Aug 16, 2019
  7. in src/rpc/rawtransaction.cpp:531 in a678e06874 outdated
     525 | @@ -528,7 +526,11 @@ static UniValue createrawtransaction(const JSONRPCRequest& request)
     526 |          }, true
     527 |      );
     528 |  
     529 | -    CMutableTransaction rawTx = ConstructTransaction(request.params[0], request.params[1], request.params[2], request.params[3]);
     530 | +    bool rbf = false;
     531 | +    if (!request.params[3].isNull()) {
     532 | +     rbf = request.params[3].isTrue();
    


    meshcollider commented at 10:00 PM on August 16, 2019:

    nit: indentation


    Sjors commented at 10:53 AM on August 17, 2019:

    Fix

  8. meshcollider commented at 10:04 PM on August 16, 2019: contributor

    I have verified that the code changes here match those in the original PR (haven't actually re-reviewed the changes though, just verified the backport)

    a678e06874e0004cd026e1969c27ecfc643ac289

  9. [rpc] walletcreatefundedpsbt: use wallet default RBF ee950ec465
  10. [doc] rpc: remove "fallback to" from RBF default help 0942a60c06
  11. [test] walletcreatefundedpsbt: check RBF is disabled when -walletrbf=0 576580fe8a
  12. Sjors force-pushed on Aug 17, 2019
  13. meshcollider commented at 10:48 AM on August 19, 2019: contributor

    re-utACK 576580fe8a063f21c0e903af1cf8f85cd6cb71d7

    Only change was indentation fix

  14. MarcoFalke renamed this:
    [0.18] Backport: Use wallet RBF default for walletcreatefundedpsbt
    [0.18] Backport #15911: Use wallet RBF default for walletcreatefundedpsbt
    on Aug 19, 2019
  15. MarcoFalke commented at 12:27 PM on August 19, 2019: member

    ACK 576580fe8a063f21c0e903af1cf8f85cd6cb71d7

    <details><summary>Show signature and timestamp</summary>

    Signature:

    -----BEGIN PGP SIGNED MESSAGE-----
    Hash: SHA512
    
    ACK 576580fe8a063f21c0e903af1cf8f85cd6cb71d7
    -----BEGIN PGP SIGNATURE-----
    
    iQGzBAEBCgAdFiEE+rVPoUahrI9sLGYTzit1aX5ppUgFAlwqrYAACgkQzit1aX5p
    pUi90wwAwVZA8P1MHIw8biLLtDV+osnhJQ8yQCXAZG2ED4snoCbV5s2SczbTgksT
    BWzEiCEQqf5s0lF1cgnCjkaYpIidpZ55O7iVSYTFnvlAd8Aw6cAH0Xe0V9VF+WhG
    0tW3GBTIaOX4ZEfwMD0nSxdAorL1UWYt3HgDjaGNlZBWzScdFlTHzLb7LXKQqLL2
    CprrQo/n2Ryp+riKB4998YserFpoudeHRcYzTR4aq0bmgfYEVtXZuxhlcz75BdQh
    nw2Ehas82qqOtszuDUbvvOkZguwUfwEtoAxH3yUxsGUUwISOPmn2ekdE8u4WRxos
    lgemrveGSKjPmEEhWKSETR97lTe6XLAjiaPtiClxAQSmBOhtuY0LqZpmhkh9B2Ru
    R6QBnF+iZDAc7e0OQ7Bqug273Swhub5YbDS2qs2YL63EO+SKo528SNcznJRHBI8a
    ZBdKWDxqMJysj5LkrW4oeIH312vcMK1wbBjiF5IZpmalShvHHux7oxPVFUpTEOfu
    ywn7IU9C
    =3lWE
    -----END PGP SIGNATURE-----
    

    Timestamp of file with hash f5a11e9d65e3f6cfd270f092131edbd8b4b33243c1a93c5ebd8c3244f41517df -

    </details>

  16. MarcoFalke referenced this in commit 00ffe5aca1 on Aug 19, 2019
  17. MarcoFalke merged this on Aug 19, 2019
  18. MarcoFalke closed this on Aug 19, 2019

  19. fanquake commented at 12:31 PM on August 19, 2019: member

    Weren't all the commits here missing the backport metadata?

  20. Sjors commented at 12:35 PM on August 19, 2019: member

    Probably, what backport metadata should be in a commit?

  21. MarcoFalke commented at 12:37 PM on August 19, 2019: member

    Maybe we should mention the backport script in the contrib/devtools readme?

  22. MarcoFalke commented at 12:40 PM on August 19, 2019: member

    The code itself was the same when I did the backport, but those were the commit differences (via range-diff):

    1:  ee950ec465 ! 1:  1057254270 [rpc] walletcreatefundedpsbt: use wallet default RBF
        @@ -2,6 +2,9 @@
         
             [rpc] walletcreatefundedpsbt: use wallet default RBF
         
        +    Github-Pull: [#15911](/bitcoin-bitcoin/15911/)
        +    Rebased-From: 4fcb698bc2bb74171cd3a14b94f9882d8e19e9fb
        +
          diff --git a/src/rpc/rawtransaction.cpp b/src/rpc/rawtransaction.cpp
          --- a/src/rpc/rawtransaction.cpp
          +++ b/src/rpc/rawtransaction.cpp
        @@ -84,6 +87,15 @@
          --- a/src/wallet/rpcwallet.cpp
          +++ b/src/wallet/rpcwallet.cpp
         @@
        +                                     {"vout_index", RPCArg::Type::NUM, RPCArg::Optional::OMITTED, "The zero-based output index, before a change output is added."},
        +                                 },
        +                             },
        +-                            {"replaceable", RPCArg::Type::BOOL, /* default */ "false", "Marks this transaction as BIP125 replaceable.\n"
        ++                            {"replaceable", RPCArg::Type::BOOL, /* default */ "wallet default", "Marks this transaction as BIP125 replaceable.\n"
        +                             "                              Allows this transaction to be replaced by a transaction with higher fees"},
        +                             {"conf_target", RPCArg::Type::NUM, /* default */ "Fallback to wallet's confirmation target", "Confirmation target (in blocks)"},
        +                             {"estimate_mode", RPCArg::Type::STR, /* default */ "UNSET", "The fee estimate mode, must be one of:\n"
        +@@
          
              CAmount fee;
              int change_position;
        @@ -119,12 +131,12 @@
                  block_height = self.nodes[0].getblockcount()
                  unspent = self.nodes[0].listunspent()[0]
         -        psbtx_info = self.nodes[0].walletcreatefundedpsbt([{"txid":unspent["txid"], "vout":unspent["vout"]}], [{self.nodes[2].getnewaddress():unspent["amount"]+1}], block_height+2, {"replaceable":True}, False)
        -+        psbtx_info = self.nodes[0].walletcreatefundedpsbt([{"txid":unspent["txid"], "vout":unspent["vout"]}], [{self.nodes[2].getnewaddress():unspent["amount"]+1}], block_height+2, {"replaceable":False}, False)
        ++        psbtx_info = self.nodes[0].walletcreatefundedpsbt([{"txid":unspent["txid"], "vout":unspent["vout"]}], [{self.nodes[2].getnewaddress():unspent["amount"]+1}], block_height+2, {"replaceable": False}, False)
                  decoded_psbt = self.nodes[0].decodepsbt(psbtx_info["psbt"])
                  for tx_in, psbt_in in zip(decoded_psbt["tx"]["vin"], decoded_psbt["inputs"]):
         -           assert_equal(tx_in["sequence"], MAX_BIP125_RBF_SEQUENCE)
         -           assert "bip32_derivs" not in psbt_in
        -+            assert(tx_in["sequence"] > MAX_BIP125_RBF_SEQUENCE)
        ++            assert tx_in["sequence"] > MAX_BIP125_RBF_SEQUENCE
         +            assert "bip32_derivs" not in psbt_in
                  assert_equal(decoded_psbt["tx"]["locktime"], block_height+2)
          
    2:  0942a60c06 ! 2:  7ab99cf477 [doc] rpc: remove "fallback to" from RBF default help
        @@ -2,6 +2,9 @@
         
             [doc] rpc: remove "fallback to" from RBF default help
         
        +    Github-Pull: [#15911](/bitcoin-bitcoin/15911/)
        +    Rebased-From: 9ed062b5685eb6227d694572cb0f7bfbcc151b36
        +
          diff --git a/src/wallet/rpcwallet.cpp b/src/wallet/rpcwallet.cpp
          --- a/src/wallet/rpcwallet.cpp
          +++ b/src/wallet/rpcwallet.cpp
        @@ -48,12 +51,3 @@
                                      {"totalFee", RPCArg::Type::NUM, /* default */ "fallback to 'confTarget'", "Total fee (NOT feerate) to pay, in satoshis.\n"
                      "                         In rare cases, the actual fee paid might be slightly higher than the specified\n"
                      "                         totalFee if the tx change output has to be removed because it is too close to\n"
        -@@
        -                                     {"vout_index", RPCArg::Type::NUM, RPCArg::Optional::OMITTED, "The zero-based output index, before a change output is added."},
        -                                 },
        -                             },
        --                            {"replaceable", RPCArg::Type::BOOL, /* default */ "false", "Marks this transaction as BIP125 replaceable.\n"
        -+                            {"replaceable", RPCArg::Type::BOOL, /* default */ "wallet default", "Marks this transaction as BIP125 replaceable.\n"
        -                             "                              Allows this transaction to be replaced by a transaction with higher fees"},
        -                             {"conf_target", RPCArg::Type::NUM, /* default */ "Fallback to wallet's confirmation target", "Confirmation target (in blocks)"},
        -                             {"estimate_mode", RPCArg::Type::STR, /* default */ "UNSET", "The fee estimate mode, must be one of:\n"
    3:  576580fe8a ! 3:  86bc93ec44 [test] walletcreatefundedpsbt: check RBF is disabled when -walletrbf=0
        @@ -2,19 +2,13 @@
         
             [test] walletcreatefundedpsbt: check RBF is disabled when -walletrbf=0
         
        +    Github-Pull: [#15911](/bitcoin-bitcoin/15911/)
        +    Rebased-From: d6b3640ac732f6f66a8cb6761084d1beecc8a876
        +
          diff --git a/test/functional/rpc_psbt.py b/test/functional/rpc_psbt.py
          --- a/test/functional/rpc_psbt.py
          +++ b/test/functional/rpc_psbt.py
         @@
        - 
        - from decimal import Decimal
        - from test_framework.test_framework import BitcoinTestFramework
        --from test_framework.util import assert_equal, assert_raises_rpc_error, connect_nodes_bi, disconnect_nodes, find_output, sync_blocks
        -+from test_framework.util import assert_equal, assert_greater_than, assert_raises_rpc_error, connect_nodes_bi, disconnect_nodes, find_output, sync_blocks
        - 
        - import json
        - import os
        -@@
                  self.num_nodes = 3
                  self.extra_args = [
                      ["-walletrbf=1"],
        @@ -24,10 +18,10 @@
                  ]
          
         @@
        -         psbtx_info = self.nodes[0].walletcreatefundedpsbt([{"txid":unspent["txid"], "vout":unspent["vout"]}], [{self.nodes[2].getnewaddress():unspent["amount"]+1}], block_height+2, {"replaceable":False}, False)
        +         psbtx_info = self.nodes[0].walletcreatefundedpsbt([{"txid":unspent["txid"], "vout":unspent["vout"]}], [{self.nodes[2].getnewaddress():unspent["amount"]+1}], block_height+2, {"replaceable": False}, False)
                  decoded_psbt = self.nodes[0].decodepsbt(psbtx_info["psbt"])
                  for tx_in, psbt_in in zip(decoded_psbt["tx"]["vin"], decoded_psbt["inputs"]):
        --            assert(tx_in["sequence"] > MAX_BIP125_RBF_SEQUENCE)
        +-            assert tx_in["sequence"] > MAX_BIP125_RBF_SEQUENCE
         +            assert_greater_than(tx_in["sequence"], MAX_BIP125_RBF_SEQUENCE)
                      assert "bip32_derivs" not in psbt_in
                  assert_equal(decoded_psbt["tx"]["locktime"], block_height+2)
    
  23. meshcollider commented at 12:51 PM on August 19, 2019: contributor

    Yeah the Github-Pull: and Rebased-From: were missing

  24. Sjors deleted the branch on Aug 19, 2019
  25. MarcoFalke commented at 1:01 PM on August 21, 2019: member
  26. MarcoFalke locked this on Dec 16, 2021

github-metadata-mirror

This is a metadata mirror of the GitHub repository bitcoin/bitcoin. This site is not affiliated with GitHub. Content is generated from a GitHub metadata backup.
generated: 2026-04-21 18:14 UTC

This site is hosted by @0xB10C
More mirrored repositories can be found on mirror.b10c.me