diff options
Diffstat (limited to 'src/txorphanage.cpp')
-rw-r--r-- | src/txorphanage.cpp | 5 |
1 files changed, 2 insertions, 3 deletions
diff --git a/src/txorphanage.cpp b/src/txorphanage.cpp index 8e76c07b07..3eaf53939d 100644 --- a/src/txorphanage.cpp +++ b/src/txorphanage.cpp @@ -119,9 +119,8 @@ void TxOrphanage::LimitOrphans(unsigned int max_orphans, FastRandomContext& rng) LOCK(m_mutex); unsigned int nEvicted = 0; - static NodeSeconds nNextSweep; auto nNow{Now<NodeSeconds>()}; - if (nNextSweep <= nNow) { + if (m_next_sweep <= nNow) { // Sweep out expired orphan pool entries: int nErased = 0; auto nMinExpTime{nNow + ORPHAN_TX_EXPIRE_TIME - ORPHAN_TX_EXPIRE_INTERVAL}; @@ -136,7 +135,7 @@ void TxOrphanage::LimitOrphans(unsigned int max_orphans, FastRandomContext& rng) } } // Sweep again 5 minutes after the next entry that expires in order to batch the linear scan. - nNextSweep = nMinExpTime + ORPHAN_TX_EXPIRE_INTERVAL; + m_next_sweep = nMinExpTime + ORPHAN_TX_EXPIRE_INTERVAL; if (nErased > 0) LogPrint(BCLog::TXPACKAGES, "Erased %d orphan tx due to expiration\n", nErased); } while (m_orphans.size() > max_orphans) |