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
62
62
return setValid.count (entry);
63
63
}
64
64
65
+ void Erase (const uint256& entry)
66
+ {
67
+ boost::unique_lock<boost::shared_mutex> lock (cs_sigcache);
68
+ setValid.erase (entry);
69
+ }
70
+
65
71
void Set (const uint256& entry)
66
72
{
67
73
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
90
96
uint256 entry;
91
97
signatureCache.ComputeEntry (entry, sighash, vchSig, pubkey);
92
98
93
- if (signatureCache.Get (entry))
99
+ if (signatureCache.Get (entry)) {
100
+ if (!store) {
101
+ signatureCache.Erase (entry);
102
+ }
94
103
return true ;
104
+ }
95
105
96
106
if (!TransactionSignatureChecker::VerifySignature (vchSig, pubkey, sighash))
97
107
return false ;
98
108
99
- if (store)
109
+ if (store) {
100
110
signatureCache.Set (entry);
111
+ }
101
112
return true ;
102
113
}
You can’t perform that action at this time.
0 commit comments