Equity
Bitcoin Protocol Library
Public Attributes | Static Public Attributes | List of all members
P2p::Message::Header Class Reference

A P2P network message header. More...

#include <Message.h>

Inheritance diagram for P2p::Message::Header:
P2p::Serializable

Public Member Functions

Overrides Serializable
virtual void serialize (std::vector< uint8_t > &out) const override
 
virtual json toJson () const override
 

Public Attributes

uint32_t magic_
 Magic number.
 
char type_ [TYPE_SIZE]
 Message type.
 
uint32_t length_
 Length of the payload.
 
uint32_t checksum_
 Payload checksum.
 

Static Public Attributes

static uint32_t const MAGIC_MAIN = 0xD9B4BEF9
 Main network magic number.
 
static uint32_t const MAGIC_TEST = 0xDAB5BFFA
 Testnet network magic number.
 
static uint32_t const MAGIC_TEST3 = 0x0709110B
 Testnet3 network magic number.
 
static size_t const MAGIC_SIZE = 4
 Size of the magic number field.
 
static size_t const TYPE_SIZE = 12
 Size of the type field.
 
static size_t const LENGTH_SIZE = 4
 Size of the length field.
 
static size_t const CHECKSUM_SIZE = 4
 Size of the checksum field.
 

Detailed Description

A P2P network message header.

See also
https://en.bitcoin.it/wiki/Protocol_documentation#Message_structure

The documentation for this class was generated from the following files: