rpc: allow specifying min chain depth for inputs in fund calls#22049
rpc: allow specifying min chain depth for inputs in fund calls#22049champo wants to merge 5 commits intobitcoin:masterfrom
Conversation
Enables users to craft BIP-125 replacements with changes to the output list, ensuring that if additional funds are needed they will be added.
achow101
left a comment
There was a problem hiding this comment.
Seems reasonable, although the use case for this is not immediately obvious to me.
Perhaps it would also be useful to add inputs_max_depth too?
| utxo1 = self.nodes[0].listunspent(0, 1, [unconfirmedAddress])[0] | ||
| assert unconfirmedTxid == utxo1['txid'] | ||
|
|
||
| self.log.info("Crafting PSBT using an unconfirmed input") |
There was a problem hiding this comment.
In 6086c58 "rpc: allow specifying min chain depth for inputs in fund calls"
| self.log.info("Crafting PSBT using an unconfirmed input") | |
| self.log.info("Crafting tx using an unconfirmed input") |
Here and elsewhere in this file too.
src/wallet/rpcwallet.cpp
Outdated
| {"include_unsafe", RPCArg::Type::BOOL, RPCArg::Default{false}, "Include inputs that are not safe to spend (unconfirmed transactions from outside keys and unconfirmed replacement transactions).\n" | ||
| "Warning: the resulting transaction may become invalid if one of the unsafe inputs disappears.\n" | ||
| "If that happens, you will need to fund the transaction with different inputs and republish it."}, | ||
| {"inputs_min_depth", RPCArg::Type::NUM, RPCArg::Default{0}, "If add_inputs is specified, require inputs with at least this chain depth."}, |
There was a problem hiding this comment.
IMO should be minconf, see listunspent RPC.
The use case is for applications that are using RBF for something else than bumping fee (as implemented by
Will do! |
|
The following sections might be updated with supplementary metadata relevant to reviewers and maintainers. ConflictsReviewers, 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. |
|
Thanks for the quick look guys! I've updated the changset with your feedback. I'm not sure what the ettiquete is here regarding squashing mid-review, so I opted to add new commits. LMK if this is not what you expect. |
src/wallet/rpcwallet.cpp
Outdated
| {"include_unsafe", RPCArg::Type::BOOL, RPCArg::Default{false}, "Include inputs that are not safe to spend (unconfirmed transactions from outside keys and unconfirmed replacement transactions).\n" | ||
| "Warning: the resulting transaction may become invalid if one of the unsafe inputs disappears.\n" | ||
| "If that happens, you will need to fund the transaction with different inputs and republish it."}, | ||
| {"minconfs", RPCArg::Type::NUM, RPCArg::Default{0}, "If add_inputs is specified, require inputs with at least this confirmations."}, |
There was a problem hiding this comment.
It's singular:
bitcoin/src/wallet/rpcwallet.cpp
Lines 2844 to 2845 in b295395
-BEGIN VERIFY SCRIPT- sed -i"" -e "s/minconfs/minconf/" ./src/wallet/rpcwallet.cpp ./test/functional/rpc_fundrawtransaction.py ./test/functional/rpc_psbt.py sed -i"" -e "s/maxconfs/maxconf/" ./src/wallet/rpcwallet.cpp ./test/functional/rpc_fundrawtransaction.py ./test/functional/rpc_psbt.py -END VERIFY SCRIPT-
|
Duplicate of #14641 ? |
|
🐙 This pull request conflicts with the target branch and needs rebase. Want to unsubscribe from rebase notifications on this pull request? Just convert this pull request to a "draft". |
There hasn't been much activity lately and the patch still needs rebase. What is the status here?
|
|
Rebased & squashed here: master...luke-jr:rpc_fundtx_minmaxconf |
|
Code review ACK. Needs rebase though. It looks like some commits can be squashed? E.g. the scripted-diff commit seems to only change code that was introduced in this same PR. |
|
@champo would you like to follow up here? |
|
Closing as this has needed rebase for more than 1 year. Feel free to reopen if you get a chance to work on this again in the future, thanks! |
Enables users to craft BIP-125 replacements with changes to the output
list, ensuring that if additional funds are inputs they will be added.