This addresses a few review comments from #21365 that were left at the time of merge (as well as some from #22166 applying to the commit it shared with #21365).
I do not think any are blockers for a 22.0 release.
Concept ACK
aCK 38844bc18492a847a6a3aff000eb0e85571070dd
utACK 9336670
ACK 9336670df5e0b8baa4169f13ba1d242ecae85d26
Checked that the introduced comments match the logic, verified by review that the code-changes are refactor-only (+ an added sanity check in TaprootBuilder::GetSpendData), built locally, ran unit tests and the functional test feature_taproot.py.
642 | CTxIn& txin = mtx.vin[i];
643 | auto coin = coins.find(txin.prevout);
644 | if (coin == coins.end() || coin->second.IsSpent()) {
645 | - have_all_spent_outputs = false;
646 | + txdata.Init(txConst, {}, true);
647 | + break;
2b19345 suggestion
@@ -636,11 +636,11 @@ bool SignTransaction(CMutableTransaction& mtx, const SigningProvider* keystore,
PrecomputedTransactionData txdata;
std::vector<CTxOut> spent_outputs;
- for (unsigned int i = 0; i < mtx.vin.size(); i++) {
+ for (unsigned int i = 0; i < mtx.vin.size(); ++i) {
CTxIn& txin = mtx.vin[i];
auto coin = coins.find(txin.prevout);
if (coin == coins.end() || coin->second.IsSpent()) {
- txdata.Init(txConst, {}, true);
+ txdata.Init(txConst, /* spent_outputs */ {}, /* force */ true);
break;
} else {
spent_outputs.emplace_back(coin->second.out.nValue, coin->second.out.scriptPubKey);
@@ -651,7 +651,7 @@ bool SignTransaction(CMutableTransaction& mtx, const SigningProvider* keystore,
}
// Sign what we can:
- for (unsigned int i = 0; i < mtx.vin.size(); i++) {
+ for (unsigned int i = 0; i < mtx.vin.size(); ++i) {
CTxIn& txin = mtx.vin[i];
Done.
171 | + * 172 | + * @param[in] tx The transaction for which data is being precomputed. 173 | + * @param[in] spent_outputs The CTxOuts being spent, one for each tx.vin, in order 174 | + * @param[in] force Precompute data for all optional features, regardless of 175 | + * what is in the inputs (used at signing time, when the inputs 176 | + * aren't filled in yet). */
8b1d3db suggestion
@@ -170,10 +170,10 @@ struct PrecomputedTransactionData
/** Initialize this PrecomputedTransactionData with transaction data.
*
* [@param](/bitcoin-bitcoin/contributor/param/)[in] tx The transaction for which data is being precomputed.
- * [@param](/bitcoin-bitcoin/contributor/param/)[in] spent_outputs The CTxOuts being spent, one for each tx.vin, in order
- * [@param](/bitcoin-bitcoin/contributor/param/)[in] force Precompute data for all optional features, regardless of
- * what is in the inputs (used at signing time, when the inputs
- * aren't filled in yet). */
+ * [@param](/bitcoin-bitcoin/contributor/param/)[in] spent_outputs The CTxOuts being spent, one for each tx.vin, in order.
+ * [@param](/bitcoin-bitcoin/contributor/param/)[in] force Whether to precompute data for all optional features,
+ * regardless of what is in the inputs (used at signing
+ * time, when the inputs aren't filled in yet). */
Done.
ACK 9336670df5e0b8baa4169f13ba1d242ecae85d26
<!--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.
It seems like after rebasing, the CKey::SignSchnorr comment improvement (previously done in commit https://github.com/bitcoin/bitcoin/commit/8b1d3dbfac899c19ab92e3591157d9f4a8c3ca49) is missing now?
These were unused except in tests, and were also overlooked when changing
SIGHASH_ALL -> SIGHASH_DEFAULT.
re-ACK 08f57a0057c58f19cd8ae3de89548d014980478a 🌴
Checked via git range-diff 9336670d...08f57a00 that since my last ACK, the only changes were jonatack's suggestions w.r.t. to doxygen comments wording and code style (https://github.com/bitcoin/bitcoin/pull/22275#discussion_r659299734, #22275 (review)) plus the rebase on master.
crACK 08f57a0 🧉
LGTM, changes check out and taproot tests passed locally.
Code review ACK 08f57a0057c58f19cd8ae3de89548d014980478a per git range-diff e9d6eb1 9336670 08f57a0 followed by re-code review per commit to swap context back into memory and debug build/run unit tests + feature_taproot.py as a sanity check