Skip to content

Commit 0048680

Browse files
committed
increase txorphan harness stability
initialize variable
1 parent 1016491 commit 0048680

File tree

2 files changed

+3
-1
lines changed

2 files changed

+3
-1
lines changed

src/txorphanage.cpp

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -119,7 +119,6 @@ void TxOrphanage::LimitOrphans(unsigned int max_orphans, FastRandomContext& rng)
119119
LOCK(m_mutex);
120120

121121
unsigned int nEvicted = 0;
122-
static NodeSeconds nNextSweep;
123122
auto nNow{Now<NodeSeconds>()};
124123
if (nNextSweep <= nNow) {
125124
// Sweep out expired orphan pool entries:

src/txorphanage.h

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -105,6 +105,9 @@ class TxOrphanage {
105105

106106
/** Erase an orphan by wtxid */
107107
int EraseTxNoLock(const Wtxid& wtxid) EXCLUSIVE_LOCKS_REQUIRED(m_mutex);
108+
109+
/** Timestamp for the next scheduled sweep of expired orphans */
110+
NodeSeconds nNextSweep GUARDED_BY(m_mutex){0s};
108111
};
109112

110113
#endif // BITCOIN_TXORPHANAGE_H

0 commit comments

Comments
 (0)