diff options
Diffstat (limited to 'src/script/sigcache.h')
| -rw-r--r-- | src/script/sigcache.h | 30 |
1 files changed, 30 insertions, 0 deletions
diff --git a/src/script/sigcache.h b/src/script/sigcache.h new file mode 100644 index 000000000..226997256 --- /dev/null +++ b/src/script/sigcache.h @@ -0,0 +1,30 @@ +// Copyright (c) 2009-2010 Satoshi Nakamoto +// Copyright (c) 2009-2014 The Bitcoin Core developers +// Distributed under the MIT software license, see the accompanying +// file COPYING or http://www.opensource.org/licenses/mit-license.php. + +#ifndef BITCOIN_SCRIPT_SIGCACHE_H +#define BITCOIN_SCRIPT_SIGCACHE_H + +#include "script/interpreter.h" + +#include <vector> + +// DoS prevention: limit cache size to less than 40MB (over 500000 +// entries on 64-bit systems). +static const unsigned int DEFAULT_MAX_SIG_CACHE_SIZE = 40; + +class CPubKey; + +class CachingTransactionSignatureChecker : public TransactionSignatureChecker +{ +private: + bool store; + +public: + CachingTransactionSignatureChecker(const CTransaction* txToIn, unsigned int nInIn, bool storeIn=true) : TransactionSignatureChecker(txToIn, nInIn), store(storeIn) {} + + bool VerifySignature(const std::vector<unsigned char>& vchSig, const CPubKey& vchPubKey, const uint256& sighash) const; +}; + +#endif // BITCOIN_SCRIPT_SIGCACHE_H |