Equity
Bitcoin Protocol Library
|
A reject message. More...
#include <RejectMessage.h>
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 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. | |
A reject message.
The reject message is sent when messages are rejected. It is sent in response to a version, tx or block message.
RejectMessage::RejectMessage | ( | std::string const & | message, |
Code | code, | ||
std::string const & | reason, | ||
std::vector< uint8_t > const & | data | ||
) |
message | Type of message rejected |
code | Code relating to rejected message |
reason | Text version of reason for rejection |
data | Optional 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 | ||
) |
[in,out] | in | pointer to the next byte to deserialize |
[in,out] | size | number of bytes remaining in the serialized stream |