Class WatchedOutput


  • public class WatchedOutput
    extends Object
    A transaction output watched by a [`ChannelMonitor`] for spends on-chain. Used to convey to a [`Filter`] such an output with a given spending condition. Any transaction spending the output must be given to [`ChannelMonitor::block_connected`] either directly or via [`Confirm::transactions_confirmed`]. If `block_hash` is `Some`, this indicates the output was created in the corresponding block and may have been spent there. See [`Filter::register_output`] for details. [`ChannelMonitor`]: channelmonitor::ChannelMonitor [`ChannelMonitor::block_connected`]: channelmonitor::ChannelMonitor::block_connected
    • Method Detail

      • get_block_hash

        @Nullable
        public byte[] get_block_hash()
        First block where the transaction output may have been spent. Note that the return value (or a relevant inner pointer) may be NULL or all-0s to represent None
      • set_block_hash

        public void set_block_hash​(@Nullable
                                   byte[] val)
        First block where the transaction output may have been spent. Note that val (or a relevant inner pointer) may be NULL or all-0s to represent None
      • get_outpoint

        public OutPoint get_outpoint()
        Outpoint identifying the transaction output.
      • set_outpoint

        public void set_outpoint​(OutPoint val)
        Outpoint identifying the transaction output.
      • get_script_pubkey

        public byte[] get_script_pubkey()
        Spending condition of the transaction output.
      • set_script_pubkey

        public void set_script_pubkey​(byte[] val)
        Spending condition of the transaction output.
      • of

        public static WatchedOutput of​(byte[] block_hash_arg,
                                       OutPoint outpoint_arg,
                                       byte[] script_pubkey_arg)
        Constructs a new WatchedOutput given each field
      • eq

        public boolean eq​(WatchedOutput b)
        Checks if two WatchedOutputs 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.
      • hash

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

        public int hashCode()
        Overrides:
        hashCode in class Object