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, recached, serializer, UNKNOWN_LENGTH
Constructor and Description |
---|
RejectMessage(NetworkParameters params,
byte[] payload) |
RejectMessage(NetworkParameters params,
RejectMessage.RejectCode code,
Sha256Hash hash,
java.lang.String message,
java.lang.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(java.io.OutputStream stream)
Serializes this message to the provided stream.
|
boolean |
equals(java.lang.Object o) |
RejectMessage.RejectCode |
getReasonCode()
The reason code given for why the peer rejected the message.
|
java.lang.String |
getReasonString()
The reason message given for rejection.
|
java.lang.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() |
java.lang.String |
toString()
A String representation of the relevant details of this reject message.
|
adjustLength, bitcoinSerialize, bitcoinSerialize, getHash, getMessageSize, getParams, hasMoreBytes, isCached, isRecached, readByte, readByteArray, readBytes, readHash, readInt64, readStr, readUint32, readUint64, readVarInt, readVarInt, setSerializer, unCache, unsafeBitcoinSerialize
public RejectMessage(NetworkParameters params, byte[] payload) throws ProtocolException
ProtocolException
public RejectMessage(NetworkParameters params, RejectMessage.RejectCode code, Sha256Hash hash, java.lang.String message, java.lang.String reason) throws ProtocolException
ProtocolException
protected void parse() throws ProtocolException
parse
in class Message
ProtocolException
public void bitcoinSerializeToStream(java.io.OutputStream stream) throws java.io.IOException
Message
bitcoinSerializeToStream
in class Message
java.io.IOException
public java.lang.String getRejectedMessage()
public Sha256Hash getRejectedObjectHash()
public RejectMessage.RejectCode getReasonCode()
public java.lang.String getReasonString()
public java.lang.String toString()
getReasonString
, which is taken from the reject message unchecked.
Through malice or otherwise, it might contain control characters or other harmful content.toString
in class java.lang.Object
public boolean equals(java.lang.Object o)
equals
in class java.lang.Object
public int hashCode()
hashCode
in class java.lang.Object