diff --git a/src/script/interpreter.cpp b/src/script/interpreter.cpp index ce08a5544a0..09ce746f0ba 100644 --- a/src/script/interpreter.cpp +++ b/src/script/interpreter.cpp @@ -2585,7 +2585,7 @@ void PrecomputedTransactionData::Init(const T& txTo, std::vector&& spent hashRangeproofs = GetRangeproofsHash(txTo); m_bip143_segwit_ready = true; } - if (uses_bip341_taproot) { + if (uses_bip341_taproot && m_spent_outputs_ready) { // line copied from GetTransactionWeight() in src/consensus/validation.h // (we cannot directly use that function for type reasons) m_tx_weight = ::GetSerializeSize(txTo, PROTOCOL_VERSION | SERIALIZE_TRANSACTION_NO_WITNESS) * (WITNESS_SCALE_FACTOR - 1) + ::GetSerializeSize(txTo, PROTOCOL_VERSION);