aboutsummaryrefslogtreecommitdiff
path: root/src/script/interpreter.h
diff options
context:
space:
mode:
authorPieter Wuille <pieter@wuille.net>2020-09-11 14:33:00 -0700
committerPieter Wuille <pieter@wuille.net>2020-10-12 02:06:32 -0700
commit5d62e3a68b6ea9bb03556ee1fbf5678f20be01a2 (patch)
treede9e5600c4d2a5718861b4331df2344fd8c47838 /src/script/interpreter.h
parent8bd2b4e78452ff69c08c37acf164a6b80e503f13 (diff)
downloadbitcoin-5d62e3a68b6ea9bb03556ee1fbf5678f20be01a2.tar.xz
refactor: keep spent outputs in PrecomputedTransactionData
A BIP-341 signature message may commit to the scriptPubKeys and amounts of all spent outputs (including other ones than the input being signed for spends), so keep them available to signature hashing code.
Diffstat (limited to 'src/script/interpreter.h')
-rw-r--r--src/script/interpreter.h4
1 files changed, 3 insertions, 1 deletions
diff --git a/src/script/interpreter.h b/src/script/interpreter.h
index 0ff4c4bc95..64cefc0d6c 100644
--- a/src/script/interpreter.h
+++ b/src/script/interpreter.h
@@ -15,6 +15,7 @@
class CPubKey;
class CScript;
class CTransaction;
+class CTxOut;
class uint256;
/** Signature hash types/flags */
@@ -122,11 +123,12 @@ struct PrecomputedTransactionData
{
uint256 hashPrevouts, hashSequence, hashOutputs;
bool m_ready = false;
+ std::vector<CTxOut> m_spent_outputs;
PrecomputedTransactionData() = default;
template <class T>
- void Init(const T& tx);
+ void Init(const T& tx, std::vector<CTxOut>&& spent_outputs);
template <class T>
explicit PrecomputedTransactionData(const T& tx);