mirror of
https://github.com/bitcoin/bitcoin.git
synced 2025-11-12 23:18:14 +01:00
Add CuckooCache implementation and replace the sigcache map_type with it
SQUASHME: Change cuckoocache to only work for powers of two, to avoid mod operator SQUASHME: Update Documentation and simplify logarithm logic SQUASHME: OSX Build Errors SQUASHME: minor Feedback from sipa + bluematt SQUASHME: DOCONLY: Clarify a few comments.
This commit is contained in:
@@ -10,9 +10,10 @@
|
||||
|
||||
#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;
|
||||
// DoS prevention: limit cache size to 32MB (over 1000000 entries on 64-bit
|
||||
// systems). Due to how we count cache size, actual memory usage is slightly
|
||||
// more (~32.25 MB)
|
||||
static const unsigned int DEFAULT_MAX_SIG_CACHE_SIZE = 32;
|
||||
|
||||
class CPubKey;
|
||||
|
||||
@@ -27,4 +28,6 @@ public:
|
||||
bool VerifySignature(const std::vector<unsigned char>& vchSig, const CPubKey& vchPubKey, const uint256& sighash) const;
|
||||
};
|
||||
|
||||
void InitSignatureCache();
|
||||
|
||||
#endif // BITCOIN_SCRIPT_SIGCACHE_H
|
||||
|
||||
Reference in New Issue
Block a user