Skip to content

Commit

Permalink
BIP341 txdata cannot be precomputed without spent outputs
Browse files Browse the repository at this point in the history
Github-Pull: #27122
Rebased-From: 95f12de
(cherry picked from commit 95f12de)
  • Loading branch information
sipa authored and psgreco committed Feb 24, 2023
1 parent 476f1db commit bc32ff6
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion src/script/interpreter.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -2585,7 +2585,7 @@ void PrecomputedTransactionData::Init(const T& txTo, std::vector<CTxOut>&& 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);
Expand Down

0 comments on commit bc32ff6

Please sign in to comment.