Class TransactionOutPoint


public class TransactionOutPoint extends ChildMessage

This message is a reference or pointer to an output of a different transaction.

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

      protected 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
    • getConnectedOutput

      @Nullable public TransactionOutput getConnectedOutput()
      An outpoint is a part of a transaction input that points to the output of another transaction. If we have both sides in memory, and they have been linked together, this returns a pointer to the connected output, or null if there is no such connection.
    • getConnectedPubKeyScript

      public byte[] getConnectedPubKeyScript()
      Returns the pubkey script from the connected output.
      Throws:
      NullPointerException - if there is no connected output.
    • getConnectedKey

      @Nullable public ECKey getConnectedKey(KeyBag keyBag) throws ScriptException
      Returns the ECKey identified in the connected output, for either P2PKH, P2WPKH or P2PK scripts. For P2SH scripts you can use getConnectedRedeemData(KeyBag) and then get the key from RedeemData. If the script form cannot be understood, throws ScriptException.
      Returns:
      an ECKey or null if the connected key cannot be found in the wallet.
      Throws:
      ScriptException
    • getConnectedRedeemData

      @Nullable public RedeemData getConnectedRedeemData(KeyBag keyBag) throws ScriptException
      Returns the RedeemData identified in the connected output, for either P2PKH, P2WPKH, P2PK or P2SH scripts. If the script forms cannot be understood, throws ScriptException.
      Returns:
      a RedeemData or null if the connected data cannot be found in the wallet.
      Throws:
      ScriptException
    • toString

      public String toString()
      Overrides:
      toString in class Object
    • getHash

      public Sha256Hash getHash()
      Returns the hash of the transaction this outpoint references/spends/is connected to.
      Overrides:
      getHash in class Message
    • getIndex

      public long getIndex()
    • setIndex

      public void setIndex(long index)
    • equals

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

      public int hashCode()
      Overrides:
      hashCode in class Object