diff options
author | Pieter Wuille <pieter@wuille.net> | 2021-03-01 18:14:47 -0800 |
---|---|---|
committer | Pieter Wuille <pieter@wuille.net> | 2021-03-15 17:29:39 -0700 |
commit | 725d7ae0494d4a45f5a840bbbd19c008a7363965 (patch) | |
tree | 86865be4926769e0ead3f66412c2bb0698c6772e | |
parent | 497718b467330b2c6bb0d44786020c55f1aa75f9 (diff) | |
download | bitcoin-725d7ae0494d4a45f5a840bbbd19c008a7363965.tar.xz |
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.
-rw-r--r-- | src/signet.cpp | 4 |
1 files changed, 3 insertions, 1 deletions
diff --git a/src/signet.cpp b/src/signet.cpp index e41b94da8d..368e16f9e7 100644 --- a/src/signet.cpp +++ b/src/signet.cpp @@ -139,7 +139,9 @@ bool CheckSignetBlockSolution(const CBlock& block, const Consensus::Params& cons const CScript& scriptSig = signet_txs->m_to_sign.vin[0].scriptSig; const CScriptWitness& witness = signet_txs->m_to_sign.vin[0].scriptWitness; - TransactionSignatureChecker sigcheck(&signet_txs->m_to_sign, /*nIn=*/ 0, /*amount=*/ signet_txs->m_to_spend.vout[0].nValue, MissingDataBehavior::ASSERT_FAIL); + PrecomputedTransactionData txdata; + txdata.Init(signet_txs->m_to_sign, {signet_txs->m_to_spend.vout[0]}); + TransactionSignatureChecker sigcheck(&signet_txs->m_to_sign, /*nIn=*/ 0, /*amount=*/ signet_txs->m_to_spend.vout[0].nValue, txdata, MissingDataBehavior::ASSERT_FAIL); if (!VerifyScript(scriptSig, signet_txs->m_to_spend.vout[0].scriptPubKey, &witness, BLOCK_SCRIPT_VERIFY_FLAGS, sigcheck)) { LogPrint(BCLog::VALIDATION, "CheckSignetBlockSolution: Errors in block (block solution invalid)\n"); |