Equity
Bitcoin Protocol Library
Public Member Functions | Public Attributes | Static Public Attributes | List of all members
Network::HeadersMessage Class Reference

A headers message. More...

#include <HeadersMessage.h>

Inheritance diagram for Network::HeadersMessage:
Network::Message P2p::Serializable

Public Member Functions

 HeadersMessage (Equity::BlockList const &blocks)
 
 HeadersMessage (uint8_t const *&in, size_t &size)
 
Overrides Serializable
virtual void serialize (std::vector< uint8_t > &out) const override
 
virtual json toJson () const override
 
- Public Member Functions inherited from Network::Message
 Message (char const *type)
 
std::string type () const
 Returns the type.
 

Public Attributes

Equity::BlockList blocks_
 Blocks with the transactions removed.
 

Static Public Attributes

static char const TYPE [] = "headers"
 Message type.
 

Detailed Description

A headers message.

Contains block headers in response to a get-headers message.

Note
The header used in this message is effectively a Block::Header plus an empty list of transactions. The block headers in this packet include a transaction count (a VarInt, so there can be more than 81 bytes per header) as opposed to the block headers that are hashed by miners. I don't know why a standard block header isn't used in this message.
See also
GetHeadersMessage

Constructor & Destructor Documentation

HeadersMessage::HeadersMessage ( Equity::BlockList const &  blocks)
Parameters
blockslist of blocks
HeadersMessage::HeadersMessage ( uint8_t const *&  in,
size_t &  size 
)
Parameters
[in,out]inpointer to the next byte to deserialize
[in,out]sizenumber of bytes remaining in the serialized stream

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