aboutsummaryrefslogtreecommitdiff
path: root/src/validation.h
diff options
context:
space:
mode:
authorPieter Wuille <pieter.wuille@gmail.com>2017-09-22 16:10:09 -0700
committerPieter Wuille <pieter.wuille@gmail.com>2017-09-22 16:17:44 -0700
commitaeed345c9bade5d52a3fbf0a943203f6c82e6344 (patch)
treea015a9100036360a3c11e8e6decdfb786bf7f453 /src/validation.h
parentc6223b3daab0328ca742b1cc3c15e89e698630bb (diff)
parent3a131b72446724b2d6322930d92348065f1c1891 (diff)
downloadbitcoin-aeed345c9bade5d52a3fbf0a943203f6c82e6344.tar.xz
Merge #10953: [Refactor] Combine scriptPubKey and amount as CTxOut in CScriptCheck
3a131b724 Rename out to m_tx_out in CScriptCheck (Johnson Lau) e91211878 [Refactor] Combine scriptPubKey and amount as CTxOut in CScriptCheck (Johnson Lau) Pull request description: This simplifies CScriptCheck by combining scriptPubKey and amount Tree-SHA512: 6422363cf5394c6cfefb30c1709db6def63230b809cc7697887e4a2e8c684149208edf91dd139e031b9fe732776b2db59305f77c3cba6f333b11cceb39ef0cc2
Diffstat (limited to 'src/validation.h')
-rw-r--r--src/validation.h13
1 files changed, 5 insertions, 8 deletions
diff --git a/src/validation.h b/src/validation.h
index 6a77fe56be..bba621b84f 100644
--- a/src/validation.h
+++ b/src/validation.h
@@ -357,8 +357,7 @@ bool CheckSequenceLocks(const CTransaction &tx, int flags, LockPoints* lp = null
class CScriptCheck
{
private:
- CScript scriptPubKey;
- CAmount amount;
+ CTxOut m_tx_out;
const CTransaction *ptxTo;
unsigned int nIn;
unsigned int nFlags;
@@ -367,17 +366,15 @@ private:
PrecomputedTransactionData *txdata;
public:
- CScriptCheck(): amount(0), ptxTo(nullptr), nIn(0), nFlags(0), cacheStore(false), error(SCRIPT_ERR_UNKNOWN_ERROR) {}
- CScriptCheck(const CScript& scriptPubKeyIn, const CAmount amountIn, const CTransaction& txToIn, unsigned int nInIn, unsigned int nFlagsIn, bool cacheIn, PrecomputedTransactionData* txdataIn) :
- scriptPubKey(scriptPubKeyIn), amount(amountIn),
- ptxTo(&txToIn), nIn(nInIn), nFlags(nFlagsIn), cacheStore(cacheIn), error(SCRIPT_ERR_UNKNOWN_ERROR), txdata(txdataIn) { }
+ CScriptCheck(): ptxTo(nullptr), nIn(0), nFlags(0), cacheStore(false), error(SCRIPT_ERR_UNKNOWN_ERROR) {}
+ CScriptCheck(const CTxOut& outIn, const CTransaction& txToIn, unsigned int nInIn, unsigned int nFlagsIn, bool cacheIn, PrecomputedTransactionData* txdataIn) :
+ m_tx_out(outIn), ptxTo(&txToIn), nIn(nInIn), nFlags(nFlagsIn), cacheStore(cacheIn), error(SCRIPT_ERR_UNKNOWN_ERROR), txdata(txdataIn) { }
bool operator()();
void swap(CScriptCheck &check) {
- scriptPubKey.swap(check.scriptPubKey);
std::swap(ptxTo, check.ptxTo);
- std::swap(amount, check.amount);
+ std::swap(m_tx_out, check.m_tx_out);
std::swap(nIn, check.nIn);
std::swap(nFlags, check.nFlags);
std::swap(cacheStore, check.cacheStore);