public class RejectMessage extends Message
Modifier and Type | Class and Description |
---|---|
static class |
RejectMessage.RejectCode |
Message.LazyParseException
checksum, cursor, length, MAX_SIZE, offset, params, parsed, parseLazy, parseRetain, payload, protocolVersion, recached, 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() |
void |
parse() |
protected void |
parseLite()
Perform the most minimal parse possible to calculate the length of the message payload.
|
String |
toString()
A String representation of the relevant details of this reject message.
|
adjustLength, bitcoinSerialize, bitcoinSerialize, ensureParsed, getHash, getMessageSize, getParams, isCached, isParsed, isRecached, maybeParse, 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 parseLite() throws ProtocolException
Message
parseLite
in class Message
ProtocolException
public void parse() throws ProtocolException
ProtocolException
public void bitcoinSerializeToStream(OutputStream stream) throws IOException
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.