Class: RejectPacket

net/packets~RejectPacket

new RejectPacket()

Reject Packet

Properties:
Name Type Attributes Description
code Number | String <nullable>

Code (see RejectPacket.codes).

msg String <nullable>

Message.

reason String <nullable>

Reason.

data Hash | Buffer <nullable>

Transaction or block hash.

Source:

Members

(static) codes :Number

Reject codes. Note that internal and higher are not meant for use on the p2p network.

Type:
  • Number
Properties:
Name Type Description
MALFORMED Number
INVALID Number
OBSOLETE Number
DUPLICATE Number
NONSTANDARD Number
DUST Number
INSUFFICIENTFEE Number
CHECKPOINT Number
INTERNAL Number
HIGHFEE Number
ALREADYKNOWN Number
CONFLICT Number
Default Value:
  • {"MALFORMED":1,"INVALID":16,"OBSOLETE":17,"DUPLICATE":18,"NONSTANDARD":64,"DUST":65,"INSUFFICIENTFEE":66,"CHECKPOINT":67,"INTERNAL":256,"HIGHFEE":256,"ALREADYKNOWN":257,"CONFLICT":258}
Source:

(static, constant) codesByVal :RevMap

Reject codes by value.

Type:
Source:

Methods

(static) fromError(err, objnullable) → {RejectPacket}

Instantiate reject packet from verify error.

Parameters:
Name Type Attributes Description
err VerifyError
obj TX | Block <nullable>
Source:
Returns:
Type
RejectPacket

(static) fromOptions(options) → {RejectPacket}

Instantiate reject packet from options.

Parameters:
Name Type Description
options Object
Source:
Returns:
Type
RejectPacket

(static) fromRaw(data, encnullable) → {RejectPacket}

Instantiate reject packet from serialized data.

Parameters:
Name Type Attributes Description
data Buffer
enc String <nullable>
Source:
Returns:
Type
RejectPacket

(static) fromReader(br) → {RejectPacket}

Instantiate reject packet from buffer reader.

Parameters:
Name Type Description
br BufferReader
Source:
Returns:
Type
RejectPacket

(static) fromReason(code, reason, objnullable) → {RejectPacket}

Instantiate reject packet from reason message.

Parameters:
Name Type Attributes Description
code Number
reason String
obj TX | Block <nullable>
Source:
Returns:
Type
RejectPacket

(private) fromOptions(options)

Inject properties from options object.

Parameters:
Name Type Description
options Object
Source:

(private) fromRaw(data)

Inject properties from serialized data.

Parameters:
Name Type Description
data Buffer
Source:

(private) fromReader(br)

Inject properties from buffer reader.

Parameters:
Name Type Description
br BufferReader
Source:

(private) fromReason(code, reason, msgnullable)

Inject properties from reason message and object.

Parameters:
Name Type Attributes Description
code Number
reason String
msg TX | Block <nullable>
Source:

getCode() → {String}

Get symbolic code.

Source:
Returns:
Type
String

getSize() → {Number}

Get serialization size.

Source:
Returns:
Type
Number

inspect() → {String}

Inspect reject packet.

Source:
Returns:
Type
String

rhash() → {Hash}

Get uint256le hash if present.

Source:
Returns:
Type
Hash

toRaw() → {Buffer}

Serialize reject packet.

Source:
Returns:
Type
Buffer

toWriter(bw)

Serialize reject packet to writer.

Parameters:
Name Type Description
bw BufferWriter
Source: