AI-generated analysisPublished automatically and not human-verified. Validated context appears in community notes below.
← Watch feed
Low 47 Bitcoin

netsync: process inv announcements when no syncPeer is set

Public commit record

What the developer wrote

Authored by Calvin Kim

95/100 · Strong
netsync: process inv announcements when no syncPeer is set

handleInvMsg early-returned for any inv from a non-syncPeer whenever
sm.current() was false, with the comment that it prevents fetching a
mass of orphans. That guard assumes a syncPeer is already fetching
blocks; when syncPeer is nil, the assumption breaks down and the
early return becomes a deadlock.

The deadlock is reachable whenever two nodes connect at equal heights:
startSync exits without picking a syncPeer (no peer is "higher"), and
nothing later promotes the freshly-mined blocks the peer announces via
inv. The pre-verack disconnect and sync-race regression tests in
integration/sync_race_test.go fail consistently because of this.

Only skip the inv when we actually have a syncPeer. When syncPeer is
nil, fall through and let the normal request path queue the block --
the inv is the only signal that there are blocks to fetch.
✓ Specific, descriptive subject✓ Names a concrete action or component✓ Provides detailed explanatory context✓ Explains rationale or failure mode✓ Mentions testing or verification
The short version

What changed, and why it matters

This commit fixes a logic bug in btcd's block synchronization code. When two Bitcoin nodes connected at the same block height, the node would refuse to process new-block announcements from its peer, causing synchronization to stall (a deadlock). The fix allows those announcements to be processed when no dedicated sync peer has been selected, so the node can continue downloading new blocks.

Recommended action

Treat as a reliability/availability fix rather than an exploitable security vulnerability. Operators should upgrade to avoid chain-tip synchronization stalls, especially in networks where nodes frequently connect at equal heights. No immediate incident response is indicated.

Security signals we found

01

Denial-of-service-like synchronization stall

02

Network consensus/partitioning risk from nodes failing to advance chain tip

03

Logic bug in peer-state guard condition

Risk score

Why this scored 47/100

Our methodology →
Potential impact 12/30
Exploitability 5/25
Stealth signal 8/15
Affected reach 10/15
Confidence 8/10
Evidence quality 4/5
Human-validated context

Community notes

Notes can correct, qualify, or add evidence to the AI analysis. Every note shown here has been validated by a human moderator.

No validated notes yet.

The AI analysis stands alone for now. Submit a note if you can add evidence or important context.