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

A reject message. More...

#include <RejectMessage.h>

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

Public Types

enum  Code {
  REJECT_MALFORMED = 0x01, REJECT_INVALID = 0x10, REJECT_OBSOLETE = 0x11, REJECT_DUPLICATE = 0x12,
  REJECT_NONSTANDARD = 0x40, REJECT_DUST = 0x41, REJECT_INSUFFICIENTFEE = 0x42, REJECT_CHECKPOINT = 0x43
}
 Values describing the reasons for a rejection.
 

Public Member Functions

 RejectMessage (std::string const &message, Code code, std::string const &reason, std::vector< uint8_t > const &data)
 
 RejectMessage (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

std::string message_
 The message type of the rejected message.
 
uint8_t code_
 The rejection code.
 
std::string reason_
 The reason for the rejection.
 
std::vector< uint8_t > data_
 Optional data related to the rejection.
 

Static Public Attributes

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

Detailed Description

A reject message.

The reject message is sent when messages are rejected. It is sent in response to a version, tx or block message.

See also
https://github.com/bitcoin/bips/blob/master/bip-0061.mediawiki

Constructor & Destructor Documentation

RejectMessage::RejectMessage ( std::string const &  message,
Code  code,
std::string const &  reason,
std::vector< uint8_t > const &  data 
)
Parameters
messageType of message rejected
codeCode relating to rejected message
reasonText version of reason for rejection
dataOptional extra data provided by some errors. Currently, all errors which provide this field fill it with the TXID or block header hash of the object being rejected, so the field is 32 bytes.
RejectMessage::RejectMessage ( 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: