1 // Copyright (c) 2009-2010 Satoshi Nakamoto
2 // Copyright (c) 2009-2014 The Bitcoin Core developers
3 // Distributed under the MIT software license, see the accompanying
4 // file COPYING or https://www.opensource.org/licenses/mit-license.php .
6 #ifndef BITCOIN_SCRIPT_SIGCACHE_H
7 #define BITCOIN_SCRIPT_SIGCACHE_H
9 #include "script/interpreter.h"
13 // DoS prevention: limit cache size to less than 40MB (over 500000
14 // entries on 64-bit systems).
15 static const unsigned int DEFAULT_MAX_SIG_CACHE_SIZE = 40;
19 class CachingTransactionSignatureChecker : public TransactionSignatureChecker
25 CachingTransactionSignatureChecker(const CTransaction* txToIn, unsigned int nInIn, const CAmount& amount, bool storeIn, PrecomputedTransactionData& txdataIn) : TransactionSignatureChecker(txToIn, nInIn, amount, txdataIn), store(storeIn) {}
27 bool VerifySignature(const std::vector<unsigned char>& vchSig, const CPubKey& vchPubKey, const uint256& sighash) const;
30 #endif // BITCOIN_SCRIPT_SIGCACHE_H