Changeset View
Changeset View
Standalone View
Standalone View
src/script/sigcache.h
Show All 37 Lines | uint32_t operator()(const uint256 &key) const { | ||||
return u; | return u; | ||||
} | } | ||||
}; | }; | ||||
class CachingTransactionSignatureChecker : public TransactionSignatureChecker { | class CachingTransactionSignatureChecker : public TransactionSignatureChecker { | ||||
private: | private: | ||||
bool store; | bool store; | ||||
bool IsCached(const std::vector<uint8_t> &vchSig, const CPubKey &vchPubKey, | |||||
const uint256 &sighash) const; | |||||
public: | public: | ||||
CachingTransactionSignatureChecker(const CTransaction *txToIn, | CachingTransactionSignatureChecker(const CTransaction *txToIn, | ||||
unsigned int nInIn, | unsigned int nInIn, | ||||
const Amount amountIn, bool storeIn, | const Amount amountIn, bool storeIn, | ||||
PrecomputedTransactionData &txdataIn) | PrecomputedTransactionData &txdataIn) | ||||
: TransactionSignatureChecker(txToIn, nInIn, amountIn, txdataIn), | : TransactionSignatureChecker(txToIn, nInIn, amountIn, txdataIn), | ||||
store(storeIn) {} | store(storeIn) {} | ||||
bool VerifySignature(const std::vector<uint8_t> &vchSig, | bool VerifySignature(const std::vector<uint8_t> &vchSig, | ||||
const CPubKey &vchPubKey, | const CPubKey &vchPubKey, | ||||
const uint256 &sighash) const override; | const uint256 &sighash) const override; | ||||
friend class TestCachingTransactionSignatureChecker; | |||||
}; | }; | ||||
void InitSignatureCache(); | void InitSignatureCache(); | ||||
#endif // BITCOIN_SCRIPT_SIGCACHE_H | #endif // BITCOIN_SCRIPT_SIGCACHE_H |