diff --git a/src/txorphanage.cpp b/src/txorphanage.cpp index 8e76c07b072..cfafadcb987 100644 --- a/src/txorphanage.cpp +++ b/src/txorphanage.cpp @@ -119,7 +119,6 @@ void TxOrphanage::LimitOrphans(unsigned int max_orphans, FastRandomContext& rng) LOCK(m_mutex); unsigned int nEvicted = 0; - static NodeSeconds nNextSweep; auto nNow{Now()}; if (nNextSweep <= nNow) { // Sweep out expired orphan pool entries: diff --git a/src/txorphanage.h b/src/txorphanage.h index 47becb447df..2da85828690 100644 --- a/src/txorphanage.h +++ b/src/txorphanage.h @@ -105,6 +105,9 @@ protected: /** Erase an orphan by wtxid */ int EraseTxNoLock(const Wtxid& wtxid) EXCLUSIVE_LOCKS_REQUIRED(m_mutex); + + /** Timestamp for the next scheduled sweep of expired orphans */ + NodeSeconds nNextSweep GUARDED_BY(m_mutex){0s}; }; #endif // BITCOIN_TXORPHANAGE_H