Follow up for #28560 (comment)
Pass vector<CTxIn>
instead of CMutableTransaction
through parameters. Pass locktime
and nVersion
as part of CoinControl
object.
The following sections might be updated with supplementary metadata relevant to reviewers and maintainers.
For detailed information about the code coverage, see the test coverage report.
See the guideline for information on the review process.
Type | Reviewers |
---|---|
Concept ACK | josibake |
If your review is incorrectly listed, please react with 👎 to this comment and the bot will ignore it on the next update.
Reviewers, this pull request conflicts with the following ones:
CreateTransaction
by brunoerg)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.
🚧 At least one of the CI tasks failed. Make sure to run all tests locally, according to the documentation.
Possibly this is due to a silent merge conflict (the changes in this pull request being incompatible with the current code in the target branch). If so, make sure to rebase on the latest commit of the target branch.
Leave a comment here, if you need help tracking down a confusing failure.
0wallet/test/fuzz/notifications.cpp:169:15: error: no matching function for call to 'FundTransaction'
1 169 | (void)FundTransaction(*wallet, tx, recipients, change_position, /*lockUnspents=*/false, coin_control);
2 | ^~~~~~~~~~~~~~~
3./wallet/spend.h:227:40: note: candidate function not viable: no known conversion from 'CMutableTransaction' to 'const std::vector<CTxIn>' for 2nd argument
4 227 | util::Result<CreatedTransactionResult> FundTransaction(CWallet& wallet, const std::vector<CTxIn>& inputs, const std::vector<CRecipient>& recipients, std::optional<unsigned int> change_pos, bool lockUnspents, CCoinControl);
5 | ^ ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
61 error generated.
Pass vector<CTxIn> intstead of CMutableTransaction through
parameters. Pass locktime and nVersion as part of CoinControl object.
CMutableTransaction
just so we can pass it to FundTransaction
. It would be nice to get rid of those too, since the only time we would actually need to start with a CMutableTransaction
is when deserializing a transaction (e.g. fundrawtransaction
) from hex and then adding funds. In almost all other cases where FundTransaction
is used, we are creating a new transaction. Since CreateTransaction
is what actually creates the transaction, creating a transaction just so we can pass the inputs and outputs to FundTransaction
seems a bit gross.
🐙 This pull request conflicts with the target branch and needs rebase.
⌛ There hasn’t been much activity lately and the patch still needs rebase. What is the status here?