From: svost Date: Mon, 3 Oct 2016 19:55:29 +0000 (+0300) Subject: Make wallet.h bit compact X-Git-Url: https://git.novaco.in/?p=novacoin.git;a=commitdiff_plain;h=33cfabf1043a43e0beada02f731b80c8975655a8 Make wallet.h bit compact --- diff --git a/src/main.cpp b/src/main.cpp index 90460db..08f089a 100644 --- a/src/main.cpp +++ b/src/main.cpp @@ -897,8 +897,33 @@ bool GetTransaction(const uint256 &hash, CTransaction &tx, uint256 &hashBlock) } +// Closure representing one script verification +// Note that this stores references to the spending transaction +class CScriptCheck +{ +private: + CScript scriptPubKey; + const CTransaction *ptxTo = nullptr; + uint32_t nIn = 0; + unsigned int nFlags = 0; + int nHashType = 0; + +public: + CScriptCheck() {} + CScriptCheck(const CTransaction& txFromIn, const CTransaction& txToIn, uint32_t nInIn, unsigned int nFlagsIn, int nHashTypeIn) : + scriptPubKey(txFromIn.vout[txToIn.vin[nInIn].prevout.n].scriptPubKey), + ptxTo(&txToIn), nIn(nInIn), nFlags(nFlagsIn), nHashType(nHashTypeIn) { } + bool operator()() const; + void swap(CScriptCheck &check) { + scriptPubKey.swap(check.scriptPubKey); + std::swap(ptxTo, check.ptxTo); + std::swap(nIn, check.nIn); + std::swap(nFlags, check.nFlags); + std::swap(nHashType, check.nHashType); + } +}; diff --git a/src/main.h b/src/main.h index a937030..2247fa6 100644 --- a/src/main.h +++ b/src/main.h @@ -727,34 +727,6 @@ protected: const CTxOut& GetOutputFor(const CTxIn& input, const MapPrevTx& inputs) const; }; -/** Closure representing one script verification - * Note that this stores references to the spending transaction */ -class CScriptCheck -{ -private: - CScript scriptPubKey; - const CTransaction *ptxTo = nullptr; - uint32_t nIn = 0; - unsigned int nFlags = 0; - int nHashType = 0; - -public: - CScriptCheck() {} - CScriptCheck(const CTransaction& txFromIn, const CTransaction& txToIn, uint32_t nInIn, unsigned int nFlagsIn, int nHashTypeIn) : - scriptPubKey(txFromIn.vout[txToIn.vin[nInIn].prevout.n].scriptPubKey), - ptxTo(&txToIn), nIn(nInIn), nFlags(nFlagsIn), nHashType(nHashTypeIn) { } - - bool operator()() const; - - void swap(CScriptCheck &check) { - scriptPubKey.swap(check.scriptPubKey); - std::swap(ptxTo, check.ptxTo); - std::swap(nIn, check.nIn); - std::swap(nFlags, check.nFlags); - std::swap(nHashType, check.nHashType); - } -}; -