Skip to content

Conversation

@champo
Copy link
Contributor

@champo champo commented May 24, 2021

Enables users to craft BIP-125 replacements with changes to the output
list, ensuring that if additional funds are inputs they will be added.

Enables users to craft BIP-125 replacements with changes to the output
list, ensuring that if additional funds are needed they will be added.
Copy link
Member

@achow101 achow101 left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

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")
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

In 6086c58 "rpc: allow specifying min chain depth for inputs in fund calls"

Suggested change
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.

Copy link
Contributor

@promag promag left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Concept ACK.

{"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."},
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

IMO should be minconf, see listunspent RPC.

@champo
Copy link
Contributor Author

champo commented May 24, 2021

Seems reasonable, although the use case for this is not immediately obvious to me.

The use case is for applications that are using RBF for something else than bumping fee (as implemented by bumpfee RPC). RBF requires new inputs added to a replacement to be confirmed. The functional tests are modeled after one of the use cases: increasing the value of an output beyond the current funding of the TX.

Perhaps it would also be useful to add inputs_max_depth too?

Will do!

@DrahtBot
Copy link
Contributor

DrahtBot commented May 24, 2021

The following sections might be updated with supplementary metadata relevant to reviewers and maintainers.

Conflicts

Reviewers, this pull request conflicts with the following ones:

  • #22686 (wallet: Use GetSelectionAmount in ApproximateBestSubset by achow101)
  • #17211 (Allow fundrawtransaction and walletcreatefundedpsbt to take external inputs by achow101)

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.

@champo
Copy link
Contributor Author

champo commented May 24, 2021

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.

{"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."},
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

It's singular:

{"minconf", RPCArg::Type::NUM, RPCArg::Default{1}, "The minimum confirmations to filter"},
{"maxconf", RPCArg::Type::NUM, RPCArg::Default{9999999}, "The maximum confirmations to filter"},

-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-
@luke-jr
Copy link
Member

luke-jr commented Jun 25, 2021

Duplicate of #14641 ?

@DrahtBot
Copy link
Contributor

🐙 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".

@DrahtBot
Copy link
Contributor

There hasn't been much activity lately and the patch still needs rebase. What is the status here?
  • Is it still relevant? ➡️ Please solve the conflicts to make it ready for review and to ensure the CI passes.
  • Is it no longer relevant? ➡️ Please close.
  • Did the author lose interest or time to work on this? ➡️ Please close it and mark it 'Up for grabs' with the label, so that it can be picked up in the future.

@luke-jr
Copy link
Member

luke-jr commented Feb 28, 2022

Rebased & squashed here: master...luke-jr:rpc_fundtx_minmaxconf

@laanwj
Copy link
Member

laanwj commented Jun 22, 2022

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.

@fanquake
Copy link
Member

@champo would you like to follow up here?

@glozow
Copy link
Member

glozow commented Sep 26, 2022

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!

@glozow glozow closed this Sep 26, 2022
@bitcoin bitcoin locked and limited conversation to collaborators Sep 26, 2023
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

8 participants