The bumpfee RPC has now the option to specify the change address which is used to identify which output will pay the fee bump.
Fixes #15331.
<!--e57a25ab6845829454e8d69fc972939a-->
The following sections might be updated with supplementary metadata relevant to reviewers and maintainers.
<!--174a7506f384e20aa4161008e828411d-->
Reviewers, this pull request conflicts with the following ones:
If you consider this pull request important, please also help to review the conflicting pull requests. Ideally, start with the one that should be merged first.
3219 | @@ -3220,6 +3220,7 @@ static UniValue bumpfee(const JSONRPCRequest& request) 3220 | " so the new transaction will not be explicitly bip-125 replaceable (though it may\n" 3221 | " still be replaceable in practice, for example if it has unconfirmed ancestors which\n" 3222 | " are replaceable)."}, 3223 | + {"changeAddress", RPCArg::Type::STR_HEX, /* opt */ true, /* default_val */ "", "The change address to pay the fee bump"},
please follow the developer guidelines for naming new arguments:
- Argument naming: use snake case `fee_delta` (and not, e.g. camel case `feeDelta`)
err, bad paste.. ty
This should verify that the selected change output is in the wallet. Bumpfee is intentionally constructed so you can't accidentally rip off the payee using it.
Nice. Concept ACK.
128 | @@ -128,6 +129,20 @@ def test_segwit_bumpfee_succeeds(rbf_node, dest_address): 129 | assert rbfid not in rbf_node.getrawmempool() 130 | 131 | 132 | +def test_change_address_succeeds(rbf_node, peer_node): 133 | + dest_address = peer_node.getnewaddress() 134 | + change_address = rbf_node.getnewaddress() 135 | + hex = rbf_node.createrawtransaction([], {dest_address: '0.00100000'})
The built-in function hex is redefined here. Choose another name :-)
Done, now using raw.
The built-in function hex is still redefined here, no? :-)
3219 | @@ -3220,6 +3220,7 @@ static UniValue bumpfee(const JSONRPCRequest& request) 3220 | " so the new transaction will not be explicitly bip-125 replaceable (though it may\n" 3221 | " still be replaceable in practice, for example if it has unconfirmed ancestors which\n" 3222 | " are replaceable)."}, 3223 | + {"change_address", RPCArg::Type::STR_HEX, /* opt */ true, /* default_val */ "", "The change address to pay the fee bump"},
{"change_address", RPCArg::Type::STR_HEX, RPCArg::Optional::OMITTED_NAMED_ARG, "The change address to pay the fee bump"},
Better: Mention what the default/fallback is
Done, please review new text.
I think the approach in #12096 is better:
However, if there is currently no change address, some way may be desired to specify one explicitly?
This should verify that the selected change output is in the wallet. Bumpfee is intentionally constructed so you can't accidentally rip off the payee using it. @gmaxwell there is no such check when specifying change address with
fundrawtransaction, so why do it here? @luke-jr I think this API is preferable for those that usefundrawtransactionwith custom change address. I don't consider this and #12096 exclusive, but happily close if #12096 is preferable. @kallewoof like @luke-jr said above, if there is no change output and an input must be added then a change output could be also added - which would use the specified change.
Ping.
<!--5d09a71f8925f3f132321140b44b946d-->The last travis run for this pull request was 364 days ago and is thus outdated. To trigger a fresh travis build, this pull request should be closed and re-opened.
<!--cf906140f33d8803c4a75a2196329ecb-->
🐙 This pull request conflicts with the target branch and needs rebase.
Closing due to lack of interest.