Class RejectMessage

java.lang.Object
org.bitcoinj.core.Message
org.bitcoinj.core.RejectMessage

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.

  • Constructor Details

  • Method Details

    • parse

      protected void parse() throws ProtocolException
      Specified by:
      parse in class Message
      Throws:
      ProtocolException
    • bitcoinSerializeToStream

      public void bitcoinSerializeToStream(OutputStream stream) throws IOException
      Description copied from class: Message
      Serializes this message to the provided stream. If you just want the raw bytes use bitcoinSerialize().
      Overrides:
      bitcoinSerializeToStream in class Message
      Throws:
      IOException
    • getRejectedMessage

      public String getRejectedMessage()
      Provides the type of message which was rejected by the peer. Note that this is ENTIRELY UNTRUSTED and should be sanity-checked before it is printed or processed.
    • getRejectedObjectHash

      public Sha256Hash getRejectedObjectHash()
      Provides the hash of the rejected object (if getRejectedMessage() is either "tx" or "block"), otherwise null.
    • getReasonCode

      public RejectMessage.RejectCode getReasonCode()
      The reason code given for why the peer rejected the message.
    • getReasonString

      public String getReasonString()
      The reason message given for rejection. Note that this is ENTIRELY UNTRUSTED and should be sanity-checked before it is printed or processed.
    • toString

      public String toString()
      A String representation of the relevant details of this reject message. Be aware that the value returned by this method includes the value returned by getReasonString, which is taken from the reject message unchecked. Through malice or otherwise, it might contain control characters or other harmful content.
      Overrides:
      toString in class Object
    • equals

      public boolean equals(Object o)
      Overrides:
      equals in class Object
    • hashCode

      public int hashCode()
      Overrides:
      hashCode in class Object