Skip to content

Commit 259c618

Browse files
committed
Fix eat-heads guard: skip when decorated_heads is empty (p2pool match)
p2pool node.py:359 guards eat-heads with 'if decorated_heads:' — when the verified chain has no scored heads, the entire head-eating loop is skipped. c2pool was missing this guard, causing all heads older than 300s to be eaten when top5 was empty (e.g. after chain disruption). This collapsed 34 heads to 2, fragmenting the chain from depth 1072 to 49 with 72 disconnected tails.
1 parent e450df9 commit 259c618

1 file changed

Lines changed: 1 addition & 0 deletions

File tree

src/impl/ltc/node.cpp

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1381,6 +1381,7 @@ void NodeImpl::clean_tracker()
13811381
// 1. Top-5 scored heads (decorated_heads[-5:])
13821382
// 2. Heads seen < 300s ago
13831383
// 3. Unverified heads whose tail has recent child activity (< 120s)
1384+
if (!m_last_top5_heads.empty()) // p2pool node.py:359: if decorated_heads:
13841385
{
13851386
// Build top-5 set for O(1) lookup
13861387
std::set<uint256> top5_set(m_last_top5_heads.begin(), m_last_top5_heads.end());

0 commit comments

Comments
 (0)