Skip to main content

Module net_processing

Module net_processing 

Source
Expand description

Net Processing — Chain synchronization and message handling

This module implements the “brain” of the P2P protocol, corresponding to Bitcoin Core’s net_processing.cpp. It orchestrates:

  • Headers-first sync: Send getheaders, receive headers, add to block index
  • Block download: Request blocks via getdata for headers we’ve accepted
  • Transaction relay: Process inv/getdata/tx messages for mempool
  • Initial Block Download (IBD): Fast sync from genesis to chain tip

§Architecture

SyncManager holds references to the BlockIndex, PeerManager, and storage ports. It processes PeerEvent messages and drives the sync state machine.

Structs§

SyncManager
The sync manager drives chain synchronization.

Enums§

HandshakeState
State of the P2P handshake with a peer.
SyncAction
Actions that the infrastructure layer should take after processing events.
SyncState
Current state of the blockchain sync process.