public class RejectMessage extends Message
A message sent by nodes when a message we sent was rejected (ie a transaction had too little fee/was invalid/etc).
Instances of this class are not safe for use by multiple threads.
Modifier and Type | Class and Description |
---|---|
static class |
RejectMessage.RejectCode |
cursor, length, MAX_SIZE, offset, params, payload, protocolVersion, recached, serializer, UNKNOWN_LENGTH
Constructor and Description |
---|
RejectMessage(NetworkParameters params,
byte[] payload) |
RejectMessage(NetworkParameters params,
RejectMessage.RejectCode code,
Sha256Hash hash,
String message,
String reason)
Constructs a reject message that fingers the object with the given hash as rejected for the given reason.
|
Modifier and Type | Method and Description |
---|---|
void |
bitcoinSerializeToStream(OutputStream stream)
Serializes this message to the provided stream.
|
boolean |
equals(Object o) |
RejectMessage.RejectCode |
getReasonCode()
The reason code given for why the peer rejected the message.
|
String |
getReasonString()
The reason message given for rejection.
|
String |
getRejectedMessage()
Provides the type of message which was rejected by the peer.
|
Sha256Hash |
getRejectedObjectHash()
Provides the hash of the rejected object (if getRejectedMessage() is either "tx" or "block"), otherwise null.
|
int |
hashCode() |
protected void |
parse() |
String |
toString()
A String representation of the relevant details of this reject message.
|
adjustLength, bitcoinSerialize, bitcoinSerialize, getHash, getMessageSize, getParams, hasMoreBytes, isCached, isRecached, readByteArray, readBytes, readHash, readInt64, readStr, readUint32, readUint64, readVarInt, readVarInt, unCache, unsafeBitcoinSerialize
public RejectMessage(NetworkParameters params, byte[] payload) throws ProtocolException
ProtocolException
public RejectMessage(NetworkParameters params, RejectMessage.RejectCode code, Sha256Hash hash, String message, String reason) throws ProtocolException
ProtocolException
protected void parse() throws ProtocolException
parse
in class Message
ProtocolException
public void bitcoinSerializeToStream(OutputStream stream) throws IOException
Message
bitcoinSerializeToStream
in class Message
IOException
public String getRejectedMessage()
public Sha256Hash getRejectedObjectHash()
public RejectMessage.RejectCode getReasonCode()
public String getReasonString()
public String toString()
getReasonString
, which is taken from the reject message unchecked.
Through malice or otherwise, it might contain control characters or other harmful content.Copyright © 2016. All rights reserved.