Construct and use PrecomputedTransactionData in PSBT signing

This commit is contained in:
Pieter Wuille
2021-03-03 16:47:44 -08:00
parent 5cb6502ac5
commit fd3f6890f3
10 changed files with 50 additions and 21 deletions

View File

@@ -1655,6 +1655,7 @@ static RPCHelpMan utxoupdatepsbt()
}
// Fill the inputs
const PrecomputedTransactionData txdata = PrecomputePSBTData(psbtx);
for (unsigned int i = 0; i < psbtx.tx->vin.size(); ++i) {
PSBTInput& input = psbtx.inputs.at(i);
@@ -1671,7 +1672,7 @@ static RPCHelpMan utxoupdatepsbt()
// Update script/keypath information using descriptor data.
// Note that SignPSBTInput does a lot more than just constructing ECDSA signatures
// we don't actually care about those here, in fact.
SignPSBTInput(public_provider, psbtx, i, /* sighash_type */ 1);
SignPSBTInput(public_provider, psbtx, i, &txdata, /* sighash_type */ 1);
}
// Update script/keypath information using descriptor data.