X-Git-Url: https://git.novaco.in/?a=blobdiff_plain;f=src%2Fmain.h;h=dc8499a4b507a6a1971886102575fc9cb8327e8b;hb=6a4bd809d3d79209ef43ee55304e744d23409582;hp=cac65cd2acf49b127f23e05e0443fdb2414ea8ad;hpb=1cb6116de830fb37b6961a8bd424b9368b397bee;p=novacoin.git diff --git a/src/main.h b/src/main.h index cac65cd..dc8499a 100644 --- a/src/main.h +++ b/src/main.h @@ -124,8 +124,7 @@ const CBlockIndex* GetLastBlockIndex(const CBlockIndex* pindex, bool fProofOfSta void StakeMiner(CWallet *pwallet); void ResendWalletTransactions(); - - +bool VerifySignature(const CTransaction& txFrom, const CTransaction& txTo, unsigned int nIn, unsigned int flags, int nHashType); @@ -706,6 +705,33 @@ 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; + unsigned int nIn; + unsigned int nFlags; + int nHashType; + +public: + CScriptCheck() {} + CScriptCheck(const CTransaction& txFromIn, const CTransaction& txToIn, unsigned int 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); + } +};