[REFACTOR] Initialize PrecomputedTransactionData in CheckInputScripts

Add a default constructor to `PrecomputedTransactionData`, which doesn't
initialize the struct's members. Instead they're initialized inside the
`CheckInputScripts()` function. This allows a later commit to add the
spent UTXOs to that structure.
This commit is contained in:
Pieter Wuille
2019-04-02 13:12:08 -07:00
committed by John Newbery
parent 5504703a9f
commit f63dec189c
3 changed files with 32 additions and 9 deletions

View File

@@ -121,7 +121,12 @@ bool CheckSignatureEncoding(const std::vector<unsigned char> &vchSig, unsigned i
struct PrecomputedTransactionData
{
uint256 hashPrevouts, hashSequence, hashOutputs;
bool ready = false;
bool m_ready = false;
PrecomputedTransactionData() = default;
template <class T>
void Init(const T& tx);
template <class T>
explicit PrecomputedTransactionData(const T& tx);