BT
← All projectsbtcsuite

btcd

Alternative full-node Bitcoin implementation written in Go.

BitcoinNode implementationsNormal
Repository coverage

209 commits in the local evidence base

Every captured commit receives deterministic security triage and a separate communication-quality score. Security candidates and broader second-pass signals receive full-patch Ollama analysis.

46security candidates22second-pass queue203AI analyses
10commits · 30 days
10commits · 60 days
147commits · 180 days
204commits · 365 days
Backfill bands
Aug 5 → Feb 621 seen1 candidatesComplete
Feb 6 → Jun 6112 seen7 candidatesComplete
Jun 6 → Jul 634 seen13 candidatesComplete
Jul 6 → Aug 530 seen7 candidatesComplete
Commit communication

Does the history explain itself?

Message quality measures whether a commit identifies its scope, purpose, rationale, testing, and supporting references. It does not change the security-severity score.

68/100 average clarity
64Strong · 80–100
80Adequate · 60–79
60Thin · 40–59
5Opaque · 0–39
Read the scoring rubric →
Developer activity

Who is changing the project?

Public Git author strings; identities are not independently verified.

DeveloperCommitsCandidatesAnalyzedHigh riskMessage avg.
Boris Nagaev461546160
Olaoluwa Osuntokun651461173
Lrifton92434186
Erick Cestari818177
Or Aharonee404184
Oliver Gugger13413047
MPins333079
Drake Thomsen222091
Eric Grill313086
Jacob Schuler111088
Julio Cesar111045
Kim111045
Analysis record

Published AI watches

Last scanned 41 minutes ago

Informational 12 AI analysisMessage 86 · Strong
BT btcsuitebtcd BitcoinNode implementations

rpcserver: test null getblock verbosity

This commit only adds a new integration test that sends a null value for the optional verbosity parameter of the getblock RPC and checks that the server returns a normal verbose block response. It does not change any production code. The t…

Regression test for a prior RPC server panic (#2600)No production code changes; defensive test coverage only
c130f0bfby Olaoluwa Osuntokun+36−01 file
No security note in commit
Moderate 65 AI analysisMessage 73 · Adequate
BT btcsuitebtcd BitcoinNode implementations

Merge pull request #2600 from allocz/fix_issue_2597

This patch fixes a server crash in btcd's JSON-RPC 'getblock' command. When a caller did not provide an optional 'verbosity' parameter, the code later dereferenced a nil pointer, causing the entire btcd process to panic. The fix supplies a…

nil-pointer dereference panic in RPC handlerdenial-of-service via crafted JSON-RPC requestserver process crash (availability impact)
a3f20384by Olaoluwa Osuntokun+5−11 file
No security note in commit
Moderate 59 AI analysisMessage 58 · Thin
BT btcsuitebtcd BitcoinNode implementations

Merge pull request #2601 from vbrekher/fix/psbt-multi-a-finalizer

This change fixes how btcd finalizes a specific type of Bitcoin Taproot smart contract called multi_a. Previously, the finalizer simply stacked signatures in the order they appeared in the PSBT file. For multi_a contracts, signatures must …

Incorrect witness ordering for multi_a tapscripts could produce invalid Bitcoin transactionsNew parser enforces standard multi_a template and rejects unsupported CHECKSIGADD constructionsDuplicate and non-matching signatures now return ErrInvalidPsbtFormat
ca0bb02cby Olaoluwa Osuntokun+366−93 files
No security note in commit
Informational 12 AI analysisMessage 95 · Strong
BT btcsuitebtcd BitcoinNode implementations

psbt: test multi_a excess signature handling

This commit only adds a new unit test for the PSBT finalizer. It checks that when a Bitcoin Taproot multi-signature (multi_a) input has more valid signatures than required, the finalizer picks exactly the required number and leaves the ext…

26ee1cc8by Olaoluwa Osuntokun+33−01 file
No security note in commit
Informational 12 AI analysisMessage 95 · Strong
BT btcsuitebtcd BitcoinNode implementations

psbt: test multi_a signature input ordering

This commit only adds a new test case to the project's test suite. It does not change any production code. The test verifies that a PSBT (Partially Signed Bitcoin Transaction) finalizer correctly orders signatures for a specific type of Ta…

Regression test for Taproot multi_a signature orderingNo production code changesDefensive guard against incorrect finalizer implementations
709069b9by Olaoluwa Osuntokun+36−131 file
No security note in commit
Informational 15 AI analysisMessage 58 · Thin
BT btcsuitebtcd BitcoinNode implementations

Merge pull request #2580 from Roasbeef/version-bump-v0.26.2

This commit only changes the software version number from v0.26.1-beta.rc1 to v0.26.2-beta. It does not modify any security-related code, network behavior, or user-facing functionality. There is no security issue here.

05585e03by Olaoluwa Osuntokun+2−21 file
No security note in commit
Informational 15 AI analysisMessage 80 · Strong
BT btcsuitebtcd BitcoinNode implementations

build: bump version to v0.26.2-beta

This commit only changes the software version number from v0.26.1-beta.rc1 to v0.26.2-beta. It does not modify any program logic, network code, or security behavior. There is no security issue here.

d9948c49by Olaoluwa Osuntokun+2−21 file
No security note in commit
Informational 15 AI analysisMessage 80 · Strong
BT btcsuitebtcd BitcoinNode implementations

build: bump version to v0.26.1-beta.rc1

This commit only changes the reported software version number from v0.26.0-beta to v0.26.1-beta.rc1. It does not alter any program logic, network behavior, or security-sensitive code. There is no security issue here.

3fa0a65cby Olaoluwa Osuntokun+2−21 file
No security note in commit
Informational 18 AI analysisMessage 78 · Adequate
BT btcsuitebtcd BitcoinNode implementations

version: preserve semantic version separators

This commit fixes a small bug in how the btcd Bitcoin node software cleans up version strings. Previously, dots in pre-release version labels like 'beta.rc1' were accidentally removed, turning them into 'betarc1'. The change adds dots to t…

No security-relevant signals in commit message or diffChange is a string-normalization correctness fixNo input from untrusted network sources is processed by this code path
65db4939by Olaoluwa Osuntokun+20−12 files
No security note in commit
Informational 15 AI analysisMessage 85 · Strong
BT btcsuitebtcd BitcoinNode implementations

build: pin tagged submodules and remove local replacements

This commit is a routine build housekeeping change. It updates two internal Go module dependencies to newly published tagged versions and removes local directory overrides so that everyone builds with the same published code. There is no i…

3d3b5e8aby Olaoluwa Osuntokun+8−82 files
No security note in commit
Informational 15 AI analysisMessage 88 · Strong
BT btcsuitebtcd BitcoinNode implementations

build: bump v2transport to v1.1.0

This commit only updates a dependency version number in the project's Go module file. It bumps the v2transport package from version 1.0.1 to 1.1.0 so that downstream projects building btcd as a module can access new handshake admission API…

8d902916by Olaoluwa Osuntokun+1−11 file
No security note in commit
Informational 12 AI analysisMessage 83 · Strong
BT btcsuitebtcd BitcoinNode implementations

rpcclient: harden DisableAuth transport tests

This commit only changes tests and clarifies a public comment. It does not alter the actual authentication behavior of the btcd RPC client. The code already only suppresses the internally generated Basic auth header when DisableAuth is tru…

No functional code change; only tests and commentsComment clarification that DisableAuth only suppresses generated Basic auth, not caller-provided Authorization headersTests now cover WebSocket handshake, cookie bypass, and caller-provided headers
52d2fadeby Olaoluwa Osuntokun+186−1272 files
No security note in commit
Informational 15 AI analysisMessage 78 · Adequate
BT btcsuitebtcd BitcoinNode implementations

rpcclient: wrap DisableAuth tests to 80 columns

This commit only reformats an existing test file. It wraps long lines to 80 columns, splits nested code into separate variables, and adjusts whitespace. No production code was changed, and no security behavior is altered.

fe84a0e1by Olaoluwa Osuntokun+83−521 file
No security note in commit
Informational 15 AI analysisMessage 96 · Strong
BT btcsuitebtcd BitcoinNode implementations

rpcclient: add tests for DisableAuth header behavior

This commit only adds new unit tests for an existing feature. It does not change any production code, so it cannot introduce a security vulnerability or fix one directly. The tests verify that an existing option called DisableAuth correctl…

9b849c17by Drake Thomsen+109−01 file
No security note in commit
Informational 21 AI analysisMessage 86 · Strong
BT btcsuitebtcd BitcoinNode implementations

rpcclient: make HTTP Basic Auth optional via DisableAuth

This change adds a new optional setting called DisableAuth to the btcd RPC client. When a user turns it on, the client will not send username/password credentials automatically. This is meant to let users connect to external Bitcoin API se…

New opt-in configuration flag that disables authentication headersDefault behavior unchanged; authentication still required unless user explicitly disables itNo validation added to ensure alternative authentication is present when DisableAuth is true
5d22b395by Drake Thomsen+25−131 file
No security note in commit
Informational 14 AI analysisMessage 83 · Strong
BT btcsuitebtcd BitcoinNode implementations

integration: stabilize pre-verack disconnect cycles

This change only modifies an integration test file. It makes a test more reliable by waiting for a version response and retrying connection attempts, rather than changing any production code that handles real Bitcoin peer connections. Ther…

76ba8842by Olaoluwa Osuntokun+58−191 file
No security note in commit
Low 27 AI analysisMessage 83 · Strong
BT btcsuitebtcd BitcoinNode implementations

server+connmgr: make outbound startup deterministic

This commit fixes a scheduling bug in how a Bitcoin node decides how many automatic outbound peers to connect to at startup. Previously, if a user had configured permanent peers, those permanent peers could grab internal connection IDs bef…

Non-deterministic outbound peer count at startupPermanent peers could consume connection request IDs before automatic counter sampledPotential for fewer automatic outbound peers than configured, reducing network diversity
58ee9ef6by Olaoluwa Osuntokun+157−224 files
No security note in commit
Low 26 AI analysisMessage 68 · Adequate
BT btcsuitebtcd BitcoinNode implementations

config: reject non-positive maxpeers

This commit fixes a configuration bug in btcd, a Bitcoin node implementation. Previously, setting maxpeers=0 caused the node to enter a tight loop: it would repeatedly try to connect to outbound peers and immediately reject them. The chang…

Denial-of-service-like resource exhaustion via tight reconnect loop triggered by a configuration valueInput validation added for a previously unbounded configuration parameterNo memory corruption, authentication bypass, or remote code execution signals present
7e9414faby Olaoluwa Osuntokun+42−23 files
No security note in commit
Informational 12 AI analysisMessage 83 · Strong
BT btcsuitebtcd BitcoinNode implementations

integration: synchronize p2p lifecycle stress batches

This commit changes only test code. It tightens up an integration test that simulates many fake Bitcoin peers connecting and disconnecting from a node, and makes a small cleanup in a unit test for closing network pipes. There is no change …

No production code changedTest-only synchronization improvementsNo authentication, cryptography, consensus, or network handling logic modified
5a2c5063by Olaoluwa Osuntokun+217−202 files
No security note in commit
Low 48 AI analysisMessage 78 · Adequate
BT btcsuitebtcd BitcoinNode implementations

v2transport: restore responder handshake progress

This commit fixes a deadlock risk in btcd's new Bitcoin v2 transport handshake. Previously, the responder waited until it had received the initiator's full 64-byte key before doing any work, which could cause both sides to sit waiting for …

BIP324 handshake deadlock avoidanceCPU admission lease split to prevent resource exhaustion / lock holding across network I/OResponder now sends key material before full initiator key is received
09717871by Olaoluwa Osuntokun+231−862 files
No security note in commit
Repository ledger

Explore captured commits

Expand any commit for its author, full message, clarity score, changed files, triage signals, analysis, and source link.

Lower-prioritywire: Reduce MaxMessagePayload to 4MBby Erick Cestari · 20378648 · Mar 6, 2026 · 1 fileMessage 60 · AdequateLow 37Details
Commit message · Erick Cestari

wire: Reduce MaxMessagePayload to 4MB

To align with Bitcoin Core, reduce the maximum message payload size from
32MB to 4MB.

60/100 · AdequateMessage clarity
✓ Descriptive subject✓ Names a concrete action or component✓ Provides an explanatory body
AI analysis · Low 37/100

This commit lowers the largest single network message btcd will accept from 32 MB down to 4 MB, matching the limit used by Bitcoin Core. The change is a hardening/configuration alignment, not a fix for a known active attack. It mainly reduces the memory and processing exposure from a peer sending an oversized protocol message, which could help mitigate denial-of-service or memory-pressure issues. There is no direct evidence in the commit that a specific vulnerability was being exploited.

Lower-prioritywire: skip IPv4-mapped IPv6 addresses in addrv2 messagesby Erick Cestari · 40eea632 · Mar 6, 2026 · 2 filesMessage 83 · StrongModerate 51Details
Commit message · Erick Cestari

wire: skip IPv4-mapped IPv6 addresses in addrv2 messages

This issue was discovered through differential fuzzing between btcd and
Bitcoin Core.

IPv4-mapped IPv6 addresses (::ffff:0:0/96, RFC 4291) sent with networkID
0x02 (IPv6) in addrv2 messages are now properly rejected. Per BIP155,
these addresses should use networkID 0x01 (IPv4) instead. This aligns
btcd's behavior with Bitcoin Core's addrv2 handling.

Changes:
- Add ipv4MappedPrefix constant for the ::ffff:0:0/96 prefix
- Add isIPv4Mapped() helper function to detect these addresses
- Update readNetAddressV2() to skip IPv4-mapped addresses with IPv6 networkID
- Add comprehensive test coverage for IPv4-mapped address detection

83/100 · StrongMessage clarity
✓ Specific, descriptive subject✓ Names a concrete action or component✓ Provides detailed explanatory context✓ Mentions testing or verification
Why it was queued
fuzzing or regression evidence
AI analysis · Moderate 51/100

This commit fixes a network-address handling bug in btcd, a Bitcoin implementation. When another node sent an IPv4 address disguised as an IPv6 address inside newer 'addrv2' peer messages, btcd would accept it. The change makes btcd reject those mismatched addresses, matching the behavior of the main Bitcoin Core software. This prevents inconsistent address records from spreading between nodes and avoids potential confusion or attacks that rely on address format tricks.

Lower-priorityaddrmgr: treat RFC7343 (ORCHIDv2) addresses as unroutableby Erick Cestari · 52e7b26a · Mar 6, 2026 · 2 filesMessage 83 · StrongLow 40Details
Commit message · Erick Cestari

addrmgr: treat RFC7343 (ORCHIDv2) addresses as unroutable

This issue was discovered through differential fuzzing between btcd and
Bitcoin Core.

Add detection and filtering of IPv6 ORCHIDv2 addresses as defined by
RFC7343 (2001:20::/28). These addresses are overlay routable
cryptographic hash identifiers and should not be treated as routable
peer addresses, consistent with Bitcoin Core's behavior.

Changes:
- Add rfc7343Net variable for the 2001:20::/28 address block
- Add IsRFC7343() function to detect ORCHIDv2 addresses
- Update IsRoutable() to exclude RFC7343 addresses
- Add comprehensive test coverage for RFC7343 detection
- Fix incorrect error message in TestIPTypes (IsRFC1918 -> IsRFC6145)

83/100 · StrongMessage clarity
✓ Specific, descriptive subject✓ Names a concrete action or component✓ Provides detailed explanatory context✓ Mentions testing or verification
Why it was queued
fuzzing or regression evidence
AI analysis · Low 40/100

This commit fixes a network-address classification bug in btcd, a Bitcoin implementation. It makes sure a special type of IPv6 address (ORCHIDv2, defined in RFC 7343) is treated as non-routable, so btcd will not try to connect to it as a regular peer. The change aligns btcd with Bitcoin Core and was found by comparing the two implementations through differential fuzzing.

Lower-prioritynetsync: add TestStartSyncChainCurrent for chain-current noop pathby Calvin Kim · 2aae8a6d · Feb 26, 2026 · 1 fileMessage 83 · StrongInformational 15Details
Commit message · Calvin Kim

netsync: add TestStartSyncChainCurrent for chain-current noop path

Verify that startSync does not set syncPeer or ibdMode when the
chain tip is recent and no peer advertises a height above ours.

83/100 · StrongMessage clarity
✓ Specific, descriptive subject✓ Names a concrete action or component✓ Provides detailed explanatory context✓ Mentions testing or verification
AI analysis · Informational 15/100

This commit only adds a new unit test. It does not change any production code, fix a bug, or alter behavior. The test checks that the Bitcoin sync manager does nothing when the local chain is already up to date and no peer has a higher block height. There is no security issue here.

Lower-prioritynetsync: add TestStallNoDisconnectAtSameHeight for stall handlerby Calvin Kim · 570d3c8d · Feb 26, 2026 · 1 fileMessage 50 · ThinInformational 15Details
Commit message · Calvin Kim

netsync: add TestStallNoDisconnectAtSameHeight for stall handler

50/100 · ThinMessage clarity
✓ Specific, descriptive subject✓ Names a concrete action or component! No meaningful explanatory body
AI analysis · Informational 15/100

This commit only adds a new unit test. It does not change any production code, so it cannot introduce a security vulnerability or fix one directly. The test checks that the sync manager does not disconnect a peer that is at the same block height when a stall is sampled.

Lower-prioritynetsync: add TestStartSyncBlockFallback for block-only sync pathby Calvin Kim · ce094262 · Feb 26, 2026 · 1 fileMessage 83 · StrongInformational 14Details
Commit message · Calvin Kim

netsync: add TestStartSyncBlockFallback for block-only sync path

Verify that startSync skips header download and directly requests
blocks when the header chain is already caught up to the peer's
height but the block chain lags behind.

83/100 · StrongMessage clarity
✓ Specific, descriptive subject✓ Names a concrete action or component✓ Provides detailed explanatory context✓ Mentions testing or verification
AI analysis · Informational 14/100

This commit only adds a new unit test to the Bitcoin-related btcd project. It checks that when the header chain is already up-to-date but the actual block chain is behind, the sync manager skips downloading headers and directly requests blocks. There is no change to production code, no bug fix, and no security-relevant behavior change.

Lower-prioritynetsync: add TestSyncStateMachine for end-to-end IBD sync flowby Calvin Kim · dc6e096c · Feb 26, 2026 · 1 fileMessage 83 · StrongInformational 15Details
Commit message · Calvin Kim

netsync: add TestSyncStateMachine for end-to-end IBD sync flow

Tests the full IBD state machine: startSync → fetchHeaders →
handleHeadersMsg → fetchHeaderBlocks → handleBlockMsg → IBD complete.

Three sub-cases exercise different paths:
- fresh IBD from genesis
- node restart with partially synced blocks
- stalled sync peer recovery via handleStallSample

83/100 · StrongMessage clarity
✓ Specific, descriptive subject✓ Names a concrete action or component✓ Provides detailed explanatory context✓ Mentions testing or verification
AI analysis · Informational 15/100

This commit only adds a new automated test file for the Bitcoin sync manager. It does not change any production code, so it cannot introduce a security vulnerability or fix one in the running software. The change is purely defensive testing: it simulates various Initial Block Download (IBD) scenarios to make sure the sync logic behaves correctly.

Lower-prioritynetsync: rename headersFirstMode to ibdModeby Calvin Kim · 0b1c7b7a · Feb 26, 2026 · 2 filesMessage 68 · AdequateInformational 15Details
Commit message · Calvin Kim

netsync: rename headersFirstMode to ibdMode

ibdMode is a more fitting name than headersFirstMode since all blocks
are downloaded headers-first during the initial block download.

68/100 · AdequateMessage clarity
✓ Descriptive subject✓ Names a concrete action or component✓ Provides detailed explanatory context
AI analysis · Informational 15/100

This commit is a simple rename of an internal variable from 'headersFirstMode' to 'ibdMode' (short for 'initial block download mode') and updates related comments. No behavior of the Bitcoin node software changes; it is purely a code clarity and naming improvement.

Lower-prioritynetsync: change startSync to be based off of processed headersby Calvin Kim · 46574cc7 · Feb 26, 2026 · 1 fileMessage 73 · AdequateLow 31Details
Commit message · Calvin Kim

netsync: change startSync to be based off of processed headers

ince we now utilize ProcessBlockHeaders, we change the startSync
function to utilize the block index for downloading blocks/headers
instead of using the headerList in SyncManager.

73/100 · AdequateMessage clarity
✓ Specific, descriptive subject✓ Names a concrete action or component✓ Provides detailed explanatory context
AI analysis · Low 31/100

This commit refactors how the Bitcoin node decides which peer to sync blocks from. It switches the sync logic to rely on the new 'processed headers' state rather than the older internal header list. The change removes direct handling of SegWit peer filtering, checkpoint-based headers-first mode, and some equality fallback logic, delegating those concerns to helper functions like fetchHigherPeers, fetchHeaders, and fetchHeaderBlocks. There is no explicit security fix described in the commit, but any refactor of consensus-critical sync code carries a risk of subtle bugs that could affect which blocks a node accepts.

Lower-prioritynetsync: update handleBlockMsgby Calvin Kim · 9530eda3 · Feb 26, 2026 · 1 fileMessage 58 · ThinInformational 23Details
Commit message · Calvin Kim

netsync: update handleBlockMsg

handleBlockMsg is updated to not be based off of the headerList and
sm.nextCheckpoint when doing operations related to checkpoints and
headers.

58/100 · ThinMessage clarity
✓ Descriptive subject✓ Provides detailed explanatory context
AI analysis · Informational 23/100

This commit refactors how btcd's network sync manager handles incoming blocks during the initial blockchain download. It moves checkpoint/header-list logic into a helper function and changes the conditions for switching from 'headers-first' mode to normal mode. The change appears to be a code cleanup and logic simplification rather than a clear security fix. There is no explicit security claim in the commit message or diff.

Lower-prioritynetsync: remove unused headerList and checkpoint codeby Calvin Kim · 5af7680b · Feb 26, 2026 · 1 fileMessage 73 · AdequateInformational 14Details
Commit message · Calvin Kim

netsync: remove unused headerList and checkpoint code

Since we no longer utilize the headerList for doing headers-first
download and checkpoint tracking, we remove related code.

73/100 · AdequateMessage clarity
✓ Specific, descriptive subject✓ Names a concrete action or component✓ Provides detailed explanatory context
AI analysis · Informational 14/100

This commit is a routine cleanup that removes leftover code for a 'headers-first' download mode and checkpoint tracking that is no longer used. There is no security issue here; it simply deletes unused fields and helper functions to make the code smaller and easier to maintain.

Lower-priorityintegration: add reorg regression test for fetchHeaderBlocks fork pointby Calvin Kim · 71792688 · Feb 26, 2026 · 1 fileMessage 83 · StrongInformational 15Details
Commit message · Calvin Kim

integration: add reorg regression test for fetchHeaderBlocks fork point

This tests that after two nodes diverge and reconnect, the shorter
node downloads blocks starting from the fork point rather than its
current height. It verifies the reorg completes, both nodes
converge, and the orphaned fork appears as a side chain via
getchaintips.

83/100 · StrongMessage clarity
✓ Specific, descriptive subject✓ Names a concrete action or component✓ Provides detailed explanatory context✓ Mentions testing or verification
Why it was queued
fuzzing or regression evidence
AI analysis · Informational 15/100

This commit only adds a new regression test file. It does not change any production code, so it cannot by itself introduce a security vulnerability or fix one. The test documents a previously fixed bug in block reorganization handling and verifies the fix remains effective.

AI review queuednetsync: require peer argument in fetchHeaderBlocksby Calvin Kim · 8588a251 · Feb 26, 2026 · 2 filesMessage 85 · StrongLow 42Details
Commit message · Calvin Kim

netsync: require peer argument in fetchHeaderBlocks

Refactor fetchHeaderBlocks and buildBlockRequest to take an explicit
peer parameter instead of implicitly using sm.syncPeer. This makes the
caller responsible for choosing which peer to fetch from and adds a nil
guard to prevent a panic if the sync peer has been cleared.

85/100 · StrongMessage clarity
✓ Specific, descriptive subject✓ Names a concrete action or component✓ Provides detailed explanatory context✓ Explains rationale or failure mode
Why it was queued
second-pass: broader security terminology
AI analysis · Low 42/100

This change is a defensive refactor in btcd's network synchronization code. It makes a block-downloading helper function take the target peer as an explicit argument instead of silently relying on a shared 'sync peer' field. It also adds checks so the function does nothing if that peer is missing, preventing a program crash (panic) in cases where the sync peer has been disconnected or cleared. There is no direct evidence this fixes an actively exploitable remote vulnerability, but it removes a crash path during peer churn.

Lower-prioritynetsync: change fetchHeaderBlocks to be based on the processed block headersby Calvin Kim · dc90f8ca · Feb 26, 2026 · 2 filesMessage 73 · AdequateLow 48Details
Commit message · Calvin Kim

netsync: change fetchHeaderBlocks to be based on the processed block
headers

We introduce buildBlockRequest that'll create a getdata message based
off of the block index instead of the headerList in SyncManager.

The new fetchHeaderBlocks utilizes buildBlockRequest and now will create
fetch requests based on the processed block headers.

73/100 · AdequateMessage clarity
✓ Specific, descriptive subject✓ Names a concrete action or component✓ Provides detailed explanatory context
AI analysis · Low 48/100

This commit fixes a bug in btcd's block-download logic. Previously, when the node asked its sync peer for blocks, it could accidentally request the same blocks twice if a routine refill triggered while those blocks were still in-flight. The duplicate block would then be treated as 'unrequested' and the peer would be disconnected, slowing or stalling synchronization. The fix builds block requests from the processed header chain and skips any blocks already marked as requested.

Lower-prioritynetsync: use ProcessBlockHeader in handleBlockHeaderby Calvin Kim · 26c24592 · Feb 26, 2026 · 1 fileMessage 65 · AdequateLow 32Details
Commit message · Calvin Kim

netsync: use ProcessBlockHeader in handleBlockHeader

Instead of the old headerList based header processing, we make use of
the new ProcessBlockHeader function.

65/100 · AdequateMessage clarity
✓ Specific, descriptive subject✓ Names a concrete action or component✓ Provides an explanatory body
AI analysis · Low 32/100

This commit refactors how btcd handles incoming block headers during peer synchronization. It replaces a custom header-list processing path with a centralized `ProcessBlockHeader` function. The most notable behavioral change is that the code no longer disconnects peers merely for sending headers when the node is not in 'headers-first sync' mode. This could allow unrequested headers to be processed, but the actual validation work is now delegated to the chain's standard header verification logic. There is no explicit security claim in the commit, and the change appears primarily architectural.

Lower-prioritynetsync: add isInIBDModeby Calvin Kim · 51576a44 · Feb 26, 2026 · 2 filesMessage 51 · ThinInformational 12Details
Commit message · Calvin Kim

netsync: add isInIBDMode

isInIBDMode returns if the SyncManager needs to download blocks and sync
to the latest chain tip.

It determines if it's in ibd mode by checking if the blockchain thinks
we're current and if we don't have peers that are at higher advertised
blocks.

51/100 · ThinMessage clarity
✓ Subject identifies a change✓ Provides detailed explanatory context
AI analysis · Informational 12/100

This commit adds a new helper function called isInIBDMode to btcd's network synchronization code. It simply checks whether the local node is still catching up to the rest of the Bitcoin network (Initial Block Download mode). The change is purely additive: it introduces the helper and its unit tests, but does not change any existing behavior or fix any visible bug on its own.

Lower-priorityblockchain: add BestChainHeaderForkHeight to return the fork point between the best chain and the best header chainby Calvin Kim · 28b6690c · Feb 26, 2026 · 1 fileMessage 65 · AdequateInformational 13Details
Commit message · Calvin Kim

blockchain: add BestChainHeaderForkHeight to return the fork point
between the best chain and the best header chain

65/100 · AdequateMessage clarity
✓ Specific, descriptive subject✓ Names a concrete action or component✓ Provides an explanatory body
AI analysis · Informational 13/100

This commit adds a new read-only helper function that reports where the chain of fully-downloaded blocks and the chain of known block headers last shared a common block. It does not change any existing behavior, fix a bug, or alter security logic. It simply exposes information already maintained internally so other code can use it for block downloads after reorganizations.

Lower-prioritynetsync: add fetchHeadersby Calvin Kim · 2f2364db · Feb 26, 2026 · 1 fileMessage 55 · ThinInformational 15Details
Commit message · Calvin Kim

netsync: add fetchHeaders

fetchHeaders picks a random peer at a higher advertised block and
requests headers from them.

55/100 · ThinMessage clarity
✓ Descriptive subject✓ Provides an explanatory body✓ Names security-relevant behavior explicitly
AI analysis · Informational 15/100

This commit adds a new internal helper function called fetchHeaders to the Bitcoin network synchronization code. It simply picks a peer that claims to have a higher block and asks that peer for block headers. There is no indication of a bug fix or security patch; it appears to be a normal feature/refactoring addition.

Lower-prioritynetsync: add fetchHigherPeersby Calvin Kim · ddf80b87 · Feb 26, 2026 · 2 filesMessage 58 · ThinInformational 15Details
Commit message · Calvin Kim

netsync: add fetchHigherPeers

fetchHigherPeers provides a convenient function to get peers that are
sync candidates and are at a higher advertised height than the passed in
height.

58/100 · ThinMessage clarity
✓ Descriptive subject✓ Provides detailed explanatory context
AI analysis · Informational 15/100

This commit adds a new internal helper function called fetchHigherPeers to the Bitcoin network synchronization code, along with unit tests. It simply returns a list of peer connections that advertise a higher blockchain height than a given value and are eligible for syncing. There is no security issue visible in this change.

Lower-prioritynetsync: add checkHeadersListby Calvin Kim · b1aef3ad · Feb 26, 2026 · 3 filesMessage 68 · AdequateInformational 12Details
Commit message · Calvin Kim

netsync: add checkHeadersList

checkHeadersList takes in a blockhash and returns if it's a checkpointed
block and the correct behavior flags for the verification of the block.

68/100 · AdequateMessage clarity
✓ Descriptive subject✓ Provides detailed explanatory context✓ Mentions testing or verification
Why it was queued
defensive validation
AI analysis · Informational 12/100

This commit adds a new internal helper function called checkHeadersList to the Bitcoin network synchronization code, along with unit tests. It decides whether a block being downloaded during initial sync should use a faster verification path (BFFastAdd) and whether the block is a known checkpoint. There is no direct evidence in the commit or supplied references that this fixes an active security vulnerability; it appears to be a correctness or refactoring change.

Lower-priorityblockchain: add ProcessBlockHeaderby Calvin Kim · c1a46122 · Feb 25, 2026 · 2 filesMessage 58 · ThinInformational 15Details
Commit message · Calvin Kim

blockchain: add ProcessBlockHeader

ProcessBlockHeader performs chain selection and context-free &
contextual validation for the given block header. The function allows
a header-first downloading of blocks even without checkpoints.

58/100 · ThinMessage clarity
✓ Descriptive subject✓ Provides detailed explanatory context
AI analysis · Informational 15/100

This commit adds a new public function, ProcessBlockHeader, to btcd's blockchain package. It is a feature addition that exposes existing internal header-validation logic so callers can download and validate block headers before receiving full blocks. There is no indication in the commit or supplied references that this fixes a security bug or introduces a vulnerability.

Lower-priorityblockchain: reuse existing header node in maybeAcceptBlockby Calvin Kim · f9645f07 · Feb 25, 2026 · 2 filesMessage 73 · AdequateModerate 58Details
Commit message · Calvin Kim

blockchain: reuse existing header node in maybeAcceptBlock

maybeAcceptBlock unconditionally created a new blockNode, overwriting the
index entry. If maybeAcceptBlockHeader had already processed the header,
the pointer held by bestHeader's chainView became orphaned, breaking
bestHeader.Contains and downstream checks like IsValidHeader.

Check for an existing node first and upgrade its status to
statusDataStored rather than replacing it.

73/100 · AdequateMessage clarity
✓ Specific, descriptive subject✓ Names a concrete action or component✓ Provides detailed explanatory context
AI analysis · Moderate 58/100

This commit fixes a bug in btcd's blockchain handling where accepting a full block could overwrite an existing header-only entry in the block index. That overwrite would leave an internal 'best header' view pointing to an orphaned record, causing later checks that rely on header membership to fail. The fix reuses the existing index entry and upgrades its status instead of replacing it.

Lower-priorityblockchain: change HaveBlock to also check for block data availabilityby Calvin Kim · e4b38e0c · Feb 25, 2026 · 3 filesMessage 73 · AdequateLow 46Details
Commit message · Calvin Kim

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.

73/100 · AdequateMessage clarity
✓ Specific, descriptive subject✓ Names a concrete action or component✓ Provides detailed explanatory context
AI analysis · Low 46/100

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.

Lower-priorityblockchain: add exports methods based on block header tipby Calvin Kim · eeb2d43a · Feb 25, 2026 · 1 fileMessage 73 · AdequateInformational 15Details
Commit message · Calvin Kim

blockchain: add exports methods based on block header tip

The added exported methods on BlockChain provide access to the block
header tip like fetching block hashes and heights from the headers
chain.

73/100 · AdequateMessage clarity
✓ Specific, descriptive subject✓ Names a concrete action or component✓ Provides detailed explanatory context
AI analysis · Informational 15/100

This commit adds five new public read-only helper methods to btcd's blockchain package so other parts of the program can query the 'header chain' tip (the longest chain of block headers). The methods only expose information that was already tracked internally; they do not change any behavior, permissions, or validation rules. There is no indication this fixes a bug or closes a security hole.

Lower-priorityblockchain: don't flush blockNodes that we don't have the data forby Calvin Kim · 9e45f60e · Feb 25, 2026 · 2 filesMessage 95 · StrongLow 32Details
Commit message · Calvin Kim

blockchain: don't flush blockNodes that we don't have the data for

On flushes to the database, we check that the blockNodes we have for
the downloaded block headers are not flushed to the disk unless the
block data is stored as well for backwards compatibility.

With older btcd clients, they rely on the fact that the blockNode is
present to check if the block data is also present. Since we now
store blockNodes for just the block headers, this is no longer true.

Because of this, we don't flush the blockNodes if there's no
accompanying block data for it. This results in downloading and
verifying the headers again if the node were to restart but since the
header data is small and the verification is quick, it's not a big
downside.

As an optimization, flushToDB now skips opening a write transaction
entirely when every dirty node is header-only. This avoids a no-op
write transaction on every ProcessBlockHeader call during header sync.

95/100 · StrongMessage clarity
✓ Specific, descriptive subject✓ Names a concrete action or component✓ Provides detailed explanatory context✓ Explains rationale or failure mode✓ Mentions testing or verification
Why it was queued
defensive validation
AI analysis · Low 32/100

This change fixes a backwards-compatibility problem in btcd, a Bitcoin implementation. Previously, when a newer btcd stored information about a block header without the full block data, it could write that header-only record to disk. If the user later opened the same database with an older btcd version, the older software would assume the full block existed and fail unrecoverably. The patch now avoids writing those header-only records to disk. It also skips unnecessary database write transactions during header-only sync, which is a performance improvement. There is no direct evidence in the commit of an active security exploit, but the unrecoverable-error scenario is a reliability and availability concern.