Skip to content

Commit 309ee1a

Browse files
committed
Update -maxsigcachesize doc clarify init logprints for it
1 parent b014668 commit 309ee1a

File tree

3 files changed

+5
-5
lines changed

3 files changed

+5
-5
lines changed

src/init.cpp

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -461,7 +461,7 @@ std::string HelpMessage(HelpMessageMode mode)
461461
{
462462
strUsage += HelpMessageOpt("-logtimemicros", strprintf("Add microsecond precision to debug timestamps (default: %u)", DEFAULT_LOGTIMEMICROS));
463463
strUsage += HelpMessageOpt("-mocktime=<n>", "Replace actual time with <n> seconds since epoch (default: 0)");
464-
strUsage += HelpMessageOpt("-maxsigcachesize=<n>", strprintf("Limit size of signature cache to <n> MiB (default: %u)", DEFAULT_MAX_SIG_CACHE_SIZE));
464+
strUsage += HelpMessageOpt("-maxsigcachesize=<n>", strprintf("Limit sum of signature cache and script execution cache sizes to <n> MiB (default: %u)", DEFAULT_MAX_SIG_CACHE_SIZE));
465465
strUsage += HelpMessageOpt("-maxtipage=<n>", strprintf("Maximum tip age in seconds to consider node in initial block download (default: %u)", DEFAULT_MAX_TIP_AGE));
466466
}
467467
strUsage += HelpMessageOpt("-maxtxfee=<amt>", strprintf(_("Maximum total fees (in %s) to use in a single wallet transaction or raw transaction; setting this too low may abort large transactions (default: %s)"),

src/script/sigcache.cpp

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -76,8 +76,8 @@ void InitSignatureCache()
7676
// setup_bytes creates the minimum possible cache (2 elements).
7777
size_t nMaxCacheSize = std::min(std::max((int64_t)0, GetArg("-maxsigcachesize", DEFAULT_MAX_SIG_CACHE_SIZE) / 2), MAX_MAX_SIG_CACHE_SIZE) * ((size_t) 1 << 20);
7878
size_t nElems = signatureCache.setup_bytes(nMaxCacheSize);
79-
LogPrintf("Using %zu MiB out of %zu requested for signature cache, able to store %zu elements\n",
80-
(nElems*sizeof(uint256)) >>20, nMaxCacheSize>>20, nElems);
79+
LogPrintf("Using %zu MiB out of %zu/2 requested for signature cache, able to store %zu elements\n",
80+
(nElems*sizeof(uint256)) >>20, (nMaxCacheSize*2)>>20, nElems);
8181
}
8282

8383
bool CachingTransactionSignatureChecker::VerifySignature(const std::vector<unsigned char>& vchSig, const CPubKey& pubkey, const uint256& sighash) const

src/validation.cpp

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1217,8 +1217,8 @@ void InitScriptExecutionCache() {
12171217
// setup_bytes creates the minimum possible cache (2 elements).
12181218
size_t nMaxCacheSize = std::min(std::max((int64_t)0, GetArg("-maxsigcachesize", DEFAULT_MAX_SIG_CACHE_SIZE) / 2), MAX_MAX_SIG_CACHE_SIZE) * ((size_t) 1 << 20);
12191219
size_t nElems = scriptExecutionCache.setup_bytes(nMaxCacheSize);
1220-
LogPrintf("Using %zu MiB out of %zu requested for script execution cache, able to store %zu elements\n",
1221-
(nElems*sizeof(uint256)) >>20, nMaxCacheSize>>20, nElems);
1220+
LogPrintf("Using %zu MiB out of %zu/2 requested for script execution cache, able to store %zu elements\n",
1221+
(nElems*sizeof(uint256)) >>20, (nMaxCacheSize*2)>>20, nElems);
12221222
}
12231223

12241224
/**

0 commit comments

Comments
 (0)