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.

    • Method Detail

      • getMessageSize

        public int getMessageSize()
        Description copied from class: Message
        Return the size of the serialized message. Note that if the message was deserialized from a payload, this size can differ from the size of the original payload.
        Overrides:
        getMessageSize in class Message
        Returns:
        size of the serialized message in bytes
      • bitcoinSerializeToStream

        protected void bitcoinSerializeToStream​(java.io.OutputStream stream)
                                         throws java.io.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:
        java.io.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:
        java.lang.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 java.lang.String toString()
        Overrides:
        toString in class java.lang.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

        @Deprecated
        public void setIndex​(long index)
        Deprecated.
        Don't mutate this class -- create a new instance instead.
        Parameters:
        index - new index
      • equals

        public boolean equals​(java.lang.Object o)
        Overrides:
        equals in class java.lang.Object
      • hashCode

        public int hashCode()
        Overrides:
        hashCode in class java.lang.Object