Skip to content

Commit 0e2dfa8

Browse files
Fix missing locking in CTxMemPool::setSanityCheck(double dFrequency)
* writing variable 'nCheckFrequency' requires holding mutex 'cs'
1 parent 6bc5b71 commit 0e2dfa8

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

src/txmempool.h

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -529,7 +529,7 @@ class CTxMemPool
529529
* check does nothing.
530530
*/
531531
void check(const CCoinsViewCache *pcoins) const;
532-
void setSanityCheck(double dFrequency = 1.0) { nCheckFrequency = static_cast<uint32_t>(dFrequency * 4294967295.0); }
532+
void setSanityCheck(double dFrequency = 1.0) { LOCK(cs); nCheckFrequency = static_cast<uint32_t>(dFrequency * 4294967295.0); }
533533

534534
// addUnchecked must updated state for all ancestors of a given transaction,
535535
// to track size/count of descendant transactions. First version of

0 commit comments

Comments
 (0)