Expand description
Bitcoin P2P framing constants: magic bytes, max message size, and common count limits.
Constantsยง
- BITCOIN_
MAGIC_ MAINNET - Mainnet P2P magic (first four bytes of each message on the wire).
- BITCOIN_
MAGIC_ REGTEST - Regtest magic.
- BITCOIN_
MAGIC_ TESTNET - Testnet magic.
- BITCOIN_
P2P_ MAGIC_ MAINNET_ LE - Mainnet magic as
u32(little-endian), for comparison withu32::from_le_byteson the header. - MAX_
ADDR_ TO_ SEND - Maximum addresses in an
addrmessage (MAX_ADDR_TO_SEND). - MAX_
HEADERS_ RESULTS - Maximum headers in a
headersmessage (MAX_HEADERS_RESULTS). - MAX_
INV_ SZ - Maximum inventory entries in
inv/getdata(MAX_INV_SZ). - MAX_
PROTOCOL_ MESSAGE_ LENGTH - Maximum P2P message size including 24-byte header (32 MiB payload cap in practice).