Constructor
new RejectPacket(optionsopt)
Create reject packet.
Parameters:
Name | Type | Attributes | Description |
---|---|---|---|
options |
Object |
<optional> |
Properties:
Name | Type | Attributes | Description |
---|---|---|---|
code |
Number | String |
<nullable> |
Code (see RejectPacket.codes). |
msg |
String |
<nullable> |
Message. |
reason |
String |
<nullable> |
Reason. |
hash |
Hash | Buffer |
<nullable> |
Transaction or block hash. |
- Source:
Extends
- Packet
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":257,"ALREADYKNOWN":258,"CONFLICT":259}
- Source:
(static, constant) codesByVal :Object
Reject codes by value.
Type:
- Object
- Source:
(nullable) hash :Hash
Type:
- Source:
Methods
(static) fromError(err, objopt, nullable) → {RejectPacket}
Instantiate reject packet from verify error.
Parameters:
Name | Type | Attributes | Description |
---|---|---|---|
err |
VerifyError | ||
obj |
TX | Block |
<optional> <nullable> |
- Source:
Returns:
- Type
- RejectPacket
(static) fromReason(codenullable, reason, msgopt, nullable, hashopt, nullable) → {RejectPacket}
Instantiate reject packet from reason message.
Parameters:
Name | Type | Attributes | Description |
---|---|---|---|
code |
String | Number |
<nullable> |
|
reason |
String | ||
msg |
Number |
<optional> <nullable> |
|
hash |
Hash |
<optional> <nullable> |
- Source:
Returns:
- Type
- RejectPacket
format() → {String}
Inspect reject packet.
- Source:
Returns:
- Type
- String
fromOptions(options)
Inject properties from options object.
Parameters:
Name | Type | Description |
---|---|---|
options |
Object |
- Source:
fromReason(codenullable, reason, msgopt, nullable, hashopt, nullable)
Inject properties from reason message and object.
Parameters:
Name | Type | Attributes | Description |
---|---|---|---|
code |
String | Number |
<nullable> |
|
reason |
String | ||
msg |
Number |
<optional> <nullable> |
|
hash |
Hash |
<optional> <nullable> |
- Source:
getCode() → {String}
Get symbolic code.
- Source:
Returns:
- Type
- String
getSize() → {Number}
Get serialization size.
- Source:
Returns:
- Type
- Number
read(br)
Inject properties from buffer reader.
Parameters:
Name | Type | Description |
---|---|---|
br |
bio.BufferReader |
- Source:
write(bw)
Serialize reject packet to writer.
Parameters:
Name | Type | Description |
---|---|---|
bw |
BufioWriter |
- Source: