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

blockchain: change HaveBlock to also check for block data availability

Public commit record

What the developer wrote

Authored by Calvin Kim

73/100 · Adequate
blockchain: change HaveBlock to also check for block data availability

In block processing and block downloading, HaveBlock is used to check if
the block data already exists. It was ok to just check for the
existence of the blockNode but we now we also need to check if the data
exists as the blockNode may be present for just the block header.
✓ Specific, descriptive subject✓ Names a concrete action or component✓ Provides detailed explanatory context
The short version

What changed, and why it matters

This commit fixes a logic bug in btcd (a Bitcoin implementation in Go). Previously, when the software was asked 'Do you already have this block?', it answered 'yes' if it knew the block's header, even if it did not actually have the full block data stored. Now it correctly checks that both the header is known and the full block data exists on disk. This could have caused the node to skip downloading a block it thought it already had, leading to incomplete data or inconsistent behavior.

Recommended action

Review callers of HaveBlock to confirm they now behave correctly when only a header is present. Ensure the fix is backported if this code is in a release branch. Consider whether any network-facing code relied on the old behavior and could now trigger unnecessary downloads.

Security signals we found

01

Logic correctness fix in block availability check

02

Potential denial-of-service or data-availability issue if node skips block download

03

Header-only block state now distinguished from full block data state

Risk score

Why this scored 46/100

Our methodology →
Potential impact 12/30
Exploitability 8/25
Stealth signal 7/15
Affected reach 10/15
Confidence 6/10
Evidence quality 3/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.