Skip to content

Commit 725d7ae

Browse files
committed
Use PrecomputedTransactionData in signet check
This is out of an abundance of caution only, as signet currently doesn't enable taproot validation flags. Still, it seems cleaner to make sure that all non-test code that passes MissingDataBehavior::ASSERT_FAIL also actually makes sure no data can be missing.
1 parent 497718b commit 725d7ae

File tree

1 file changed

+3
-1
lines changed

1 file changed

+3
-1
lines changed

src/signet.cpp

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -139,7 +139,9 @@ bool CheckSignetBlockSolution(const CBlock& block, const Consensus::Params& cons
139139
const CScript& scriptSig = signet_txs->m_to_sign.vin[0].scriptSig;
140140
const CScriptWitness& witness = signet_txs->m_to_sign.vin[0].scriptWitness;
141141

142-
TransactionSignatureChecker sigcheck(&signet_txs->m_to_sign, /*nIn=*/ 0, /*amount=*/ signet_txs->m_to_spend.vout[0].nValue, MissingDataBehavior::ASSERT_FAIL);
142+
PrecomputedTransactionData txdata;
143+
txdata.Init(signet_txs->m_to_sign, {signet_txs->m_to_spend.vout[0]});
144+
TransactionSignatureChecker sigcheck(&signet_txs->m_to_sign, /*nIn=*/ 0, /*amount=*/ signet_txs->m_to_spend.vout[0].nValue, txdata, MissingDataBehavior::ASSERT_FAIL);
143145

144146
if (!VerifyScript(scriptSig, signet_txs->m_to_spend.vout[0].scriptPubKey, &witness, BLOCK_SCRIPT_VERIFY_FLAGS, sigcheck)) {
145147
LogPrint(BCLog::VALIDATION, "CheckSignetBlockSolution: Errors in block (block solution invalid)\n");

0 commit comments

Comments
 (0)