[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

    Signature:

     0-----BEGIN PGP SIGNED MESSAGE-----
     1Hash: SHA512
     2
     3ACK 576580fe8a063f21c0e903af1cf8f85cd6cb71d7
     4-----BEGIN PGP SIGNATURE-----
     5
     6iQGzBAEBCgAdFiEE+rVPoUahrI9sLGYTzit1aX5ppUgFAlwqrYAACgkQzit1aX5p
     7pUi90wwAwVZA8P1MHIw8biLLtDV+osnhJQ8yQCXAZG2ED4snoCbV5s2SczbTgksT
     8BWzEiCEQqf5s0lF1cgnCjkaYpIidpZ55O7iVSYTFnvlAd8Aw6cAH0Xe0V9VF+WhG
     90tW3GBTIaOX4ZEfwMD0nSxdAorL1UWYt3HgDjaGNlZBWzScdFlTHzLb7LXKQqLL2
    10CprrQo/n2Ryp+riKB4998YserFpoudeHRcYzTR4aq0bmgfYEVtXZuxhlcz75BdQh
    11nw2Ehas82qqOtszuDUbvvOkZguwUfwEtoAxH3yUxsGUUwISOPmn2ekdE8u4WRxos
    12lgemrveGSKjPmEEhWKSETR97lTe6XLAjiaPtiClxAQSmBOhtuY0LqZpmhkh9B2Ru
    13R6QBnF+iZDAc7e0OQ7Bqug273Swhub5YbDS2qs2YL63EO+SKo528SNcznJRHBI8a
    14ZBdKWDxqMJysj5LkrW4oeIH312vcMK1wbBjiF5IZpmalShvHHux7oxPVFUpTEOfu
    15ywn7IU9C
    16=3lWE
    17-----END PGP SIGNATURE-----
    

    Timestamp of file with hash f5a11e9d65e3f6cfd270f092131edbd8b4b33243c1a93c5ebd8c3244f41517df -

  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):

      01:  ee950ec465 ! 1:  1057254270 [rpc] walletcreatefundedpsbt: use wallet default RBF
      1    @@ -2,6 +2,9 @@
      2     
      3         [rpc] walletcreatefundedpsbt: use wallet default RBF
      4     
      5    +    Github-Pull: [#15911](/bitcoin-bitcoin/15911/)
      6    +    Rebased-From: 4fcb698bc2bb74171cd3a14b94f9882d8e19e9fb
      7    +
      8      diff --git a/src/rpc/rawtransaction.cpp b/src/rpc/rawtransaction.cpp
      9      --- a/src/rpc/rawtransaction.cpp
     10      +++ b/src/rpc/rawtransaction.cpp
     11    @@ -84,6 +87,15 @@
     12      --- a/src/wallet/rpcwallet.cpp
     13      +++ b/src/wallet/rpcwallet.cpp
     14     @@
     15    +                                     {"vout_index", RPCArg::Type::NUM, RPCArg::Optional::OMITTED, "The zero-based output index, before a change output is added."},
     16    +                                 },
     17    +                             },
     18    +-                            {"replaceable", RPCArg::Type::BOOL, /* default */ "false", "Marks this transaction as BIP125 replaceable.\n"
     19    ++                            {"replaceable", RPCArg::Type::BOOL, /* default */ "wallet default", "Marks this transaction as BIP125 replaceable.\n"
     20    +                             "                              Allows this transaction to be replaced by a transaction with higher fees"},
     21    +                             {"conf_target", RPCArg::Type::NUM, /* default */ "Fallback to wallet's confirmation target", "Confirmation target (in blocks)"},
     22    +                             {"estimate_mode", RPCArg::Type::STR, /* default */ "UNSET", "The fee estimate mode, must be one of:\n"
     23    +@@
     24      
     25          CAmount fee;
     26          int change_position;
     27    @@ -119,12 +131,12 @@
     28              block_height = self.nodes[0].getblockcount()
     29              unspent = self.nodes[0].listunspent()[0]
     30     -        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)
     31    -+        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)
     32    ++        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)
     33              decoded_psbt = self.nodes[0].decodepsbt(psbtx_info["psbt"])
     34              for tx_in, psbt_in in zip(decoded_psbt["tx"]["vin"], decoded_psbt["inputs"]):
     35     -           assert_equal(tx_in["sequence"], MAX_BIP125_RBF_SEQUENCE)
     36     -           assert "bip32_derivs" not in psbt_in
     37    -+            assert(tx_in["sequence"] > MAX_BIP125_RBF_SEQUENCE)
     38    ++            assert tx_in["sequence"] > MAX_BIP125_RBF_SEQUENCE
     39     +            assert "bip32_derivs" not in psbt_in
     40              assert_equal(decoded_psbt["tx"]["locktime"], block_height+2)
     41      
     422:  0942a60c06 ! 2:  7ab99cf477 [doc] rpc: remove "fallback to" from RBF default help
     43    @@ -2,6 +2,9 @@
     44     
     45         [doc] rpc: remove "fallback to" from RBF default help
     46     
     47    +    Github-Pull: [#15911](/bitcoin-bitcoin/15911/)
     48    +    Rebased-From: 9ed062b5685eb6227d694572cb0f7bfbcc151b36
     49    +
     50      diff --git a/src/wallet/rpcwallet.cpp b/src/wallet/rpcwallet.cpp
     51      --- a/src/wallet/rpcwallet.cpp
     52      +++ b/src/wallet/rpcwallet.cpp
     53    @@ -48,12 +51,3 @@
     54                                  {"totalFee", RPCArg::Type::NUM, /* default */ "fallback to 'confTarget'", "Total fee (NOT feerate) to pay, in satoshis.\n"
     55                  "                         In rare cases, the actual fee paid might be slightly higher than the specified\n"
     56                  "                         totalFee if the tx change output has to be removed because it is too close to\n"
     57    -@@
     58    -                                     {"vout_index", RPCArg::Type::NUM, RPCArg::Optional::OMITTED, "The zero-based output index, before a change output is added."},
     59    -                                 },
     60    -                             },
     61    --                            {"replaceable", RPCArg::Type::BOOL, /* default */ "false", "Marks this transaction as BIP125 replaceable.\n"
     62    -+                            {"replaceable", RPCArg::Type::BOOL, /* default */ "wallet default", "Marks this transaction as BIP125 replaceable.\n"
     63    -                             "                              Allows this transaction to be replaced by a transaction with higher fees"},
     64    -                             {"conf_target", RPCArg::Type::NUM, /* default */ "Fallback to wallet's confirmation target", "Confirmation target (in blocks)"},
     65    -                             {"estimate_mode", RPCArg::Type::STR, /* default */ "UNSET", "The fee estimate mode, must be one of:\n"
     663:  576580fe8a ! 3:  86bc93ec44 [test] walletcreatefundedpsbt: check RBF is disabled when -walletrbf=0
     67    @@ -2,19 +2,13 @@
     68     
     69         [test] walletcreatefundedpsbt: check RBF is disabled when -walletrbf=0
     70     
     71    +    Github-Pull: [#15911](/bitcoin-bitcoin/15911/)
     72    +    Rebased-From: d6b3640ac732f6f66a8cb6761084d1beecc8a876
     73    +
     74      diff --git a/test/functional/rpc_psbt.py b/test/functional/rpc_psbt.py
     75      --- a/test/functional/rpc_psbt.py
     76      +++ b/test/functional/rpc_psbt.py
     77     @@
     78    - 
     79    - from decimal import Decimal
     80    - from test_framework.test_framework import BitcoinTestFramework
     81    --from test_framework.util import assert_equal, assert_raises_rpc_error, connect_nodes_bi, disconnect_nodes, find_output, sync_blocks
     82    -+from test_framework.util import assert_equal, assert_greater_than, assert_raises_rpc_error, connect_nodes_bi, disconnect_nodes, find_output, sync_blocks
     83    - 
     84    - import json
     85    - import os
     86    -@@
     87              self.num_nodes = 3
     88              self.extra_args = [
     89                  ["-walletrbf=1"],
     90    @@ -24,10 +18,10 @@
     91              ]
     92      
     93     @@
     94    -         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)
     95    +         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)
     96              decoded_psbt = self.nodes[0].decodepsbt(psbtx_info["psbt"])
     97              for tx_in, psbt_in in zip(decoded_psbt["tx"]["vin"], decoded_psbt["inputs"]):
     98    --            assert(tx_in["sequence"] > MAX_BIP125_RBF_SEQUENCE)
     99    +-            assert tx_in["sequence"] > MAX_BIP125_RBF_SEQUENCE
    100     +            assert_greater_than(tx_in["sequence"], MAX_BIP125_RBF_SEQUENCE)
    101                  assert "bip32_derivs" not in psbt_in
    102              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: 2024-12-25 18:12 UTC

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