pub fn process_network_message(
engine: &BitcoinProtocolEngine,
message: &NetworkMessage,
peer_state: &mut PeerState,
chain_access: Option<&dyn ChainStateAccess>,
utxo_set: Option<&UtxoSet>,
height: Option<u64>,
) -> Result<NetworkResponse>Expand description
Process incoming network message
This function handles Bitcoin P2P protocol messages, applying protocol-specific limits and delegating consensus validation to the protocol engine.
§Arguments
engine- The protocol engine (contains consensus layer)message- The network message to processpeer_state- Current peer connection statechain_access- Optional chain state access (node layer provides this)utxo_set- Optional UTXO set for block validationheight- Optional block height for validation context
§Returns
A NetworkResponse indicating the result of processing