Ensure -maxsigcachesize is in valid range

- If the -maxsigcachesize parameter is set to zero, setup a minimum sized
sigcache (2 elements) rather than segfaulting.
- Handle maxsigcachesize being negative
- Handle maxsigcachesize being too large
This commit is contained in:
John Newbery
2017-02-15 14:19:16 -05:00
committed by Wladimir J. van der Laan
parent 476cc47da0
commit 55c403b8fe
2 changed files with 5 additions and 2 deletions

View File

@@ -14,6 +14,8 @@
// 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;
// Maximum sig cache size allowed
static const int64_t MAX_MAX_SIG_CACHE_SIZE = 16384;
class CPubKey;