File tree Expand file tree Collapse file tree 1 file changed +13
-2
lines changed
Expand file tree Collapse file tree 1 file changed +13
-2
lines changed Original file line number Diff line number Diff line change @@ -62,6 +62,12 @@ class CSignatureCache
6262 return setValid.count (entry);
6363 }
6464
65+ void Erase (const uint256& entry)
66+ {
67+ boost::unique_lock<boost::shared_mutex> lock (cs_sigcache);
68+ setValid.erase (entry);
69+ }
70+
6571 void Set (const uint256& entry)
6672 {
6773 size_t nMaxCacheSize = GetArg (" -maxsigcachesize" , DEFAULT_MAX_SIG_CACHE_SIZE) * ((size_t ) 1 << 20 );
@@ -90,13 +96,18 @@ bool CachingTransactionSignatureChecker::VerifySignature(const std::vector<unsig
9096 uint256 entry;
9197 signatureCache.ComputeEntry (entry, sighash, vchSig, pubkey);
9298
93- if (signatureCache.Get (entry))
99+ if (signatureCache.Get (entry)) {
100+ if (!store) {
101+ signatureCache.Erase (entry);
102+ }
94103 return true ;
104+ }
95105
96106 if (!TransactionSignatureChecker::VerifySignature (vchSig, pubkey, sighash))
97107 return false ;
98108
99- if (store)
109+ if (store) {
100110 signatureCache.Set (entry);
111+ }
101112 return true ;
102113}
You can’t perform that action at this time.
0 commit comments