increase txorphan harness stability

initialize variable
This commit is contained in:
marcofleon 2024-05-28 09:45:19 -07:00
parent 10164916f7
commit 0048680467
2 changed files with 3 additions and 1 deletions

View file

@ -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<NodeSeconds>()};
if (nNextSweep <= nNow) {
// Sweep out expired orphan pool entries:

View file

@ -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