Skip to content

Commit bc32ff6

Browse files
sipapsgreco
authored andcommitted
BIP341 txdata cannot be precomputed without spent outputs
Github-Pull: #27122 Rebased-From: 95f12de (cherry picked from commit 95f12de)
1 parent 476f1db commit bc32ff6

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

src/script/interpreter.cpp

+1-1
Original file line numberDiff line numberDiff line change
@@ -2585,7 +2585,7 @@ void PrecomputedTransactionData::Init(const T& txTo, std::vector<CTxOut>&& spent
25852585
hashRangeproofs = GetRangeproofsHash(txTo);
25862586
m_bip143_segwit_ready = true;
25872587
}
2588-
if (uses_bip341_taproot) {
2588+
if (uses_bip341_taproot && m_spent_outputs_ready) {
25892589
// line copied from GetTransactionWeight() in src/consensus/validation.h
25902590
// (we cannot directly use that function for type reasons)
25912591
m_tx_weight = ::GetSerializeSize(txTo, PROTOCOL_VERSION | SERIALIZE_TRANSACTION_NO_WITNESS) * (WITNESS_SCALE_FACTOR - 1) + ::GetSerializeSize(txTo, PROTOCOL_VERSION);

0 commit comments

Comments
 (0)