Class ClosingTransaction


  • public class ClosingTransaction
    extends Object
    This class tracks the per-transaction information needed to build a closing transaction and will actually build it and sign. This class can be used inside a signer implementation to generate a signature given the relevant secret key.
    • Method Detail

      • hash

        public long hash()
        Generates a non-cryptographic 64-bit hash of the ClosingTransaction.
      • hashCode

        public int hashCode()
        Overrides:
        hashCode in class Object
      • eq

        public boolean eq​(ClosingTransaction b)
        Checks if two ClosingTransactions contain equal inner contents. This ignores pointers and is_owned flags and looks at the values in fields. Two objects with NULL inner values will be considered "equal" here.
      • of

        public static ClosingTransaction of​(long to_holder_value_sat,
                                            long to_counterparty_value_sat,
                                            byte[] to_holder_script,
                                            byte[] to_counterparty_script,
                                            OutPoint funding_outpoint)
        Construct an object of the class
      • trust

        public TrustedClosingTransaction trust()
        Trust our pre-built transaction. Applies a wrapper which allows access to the transaction. This should only be used if you fully trust the builder of this object. It should not be used by an external signer - instead use the verify function.
      • verify

        public Result_TrustedClosingTransactionNoneZ verify​(OutPoint funding_outpoint)
        Verify our pre-built transaction. Applies a wrapper which allows access to the transaction. An external validating signer must call this method before signing or using the built transaction.
      • to_holder_value_sat

        public long to_holder_value_sat()
        The value to be sent to the holder, or zero if the output will be omitted
      • to_counterparty_value_sat

        public long to_counterparty_value_sat()
        The value to be sent to the counterparty, or zero if the output will be omitted
      • to_holder_script

        public byte[] to_holder_script()
        The destination of the holder's output
      • to_counterparty_script

        public byte[] to_counterparty_script()
        The destination of the counterparty's output