Class ChannelDetails


  • public class ChannelDetails
    extends Object
    Details of a channel, as returned by ChannelManager::list_channels and ChannelManager::list_usable_channels
    • Method Summary

      All Methods Static Methods Instance Methods Concrete Methods 
      Modifier and Type Method Description
      ChannelDetails clone()
      Creates a copy of the ChannelDetails
      protected void finalize()  
      byte[] get_channel_id()
      The channel's ID (prior to funding transaction generation, this is a random 32 bytes, thereafter this is the txid of the funding transaction xor the funding transaction output).
      long get_channel_value_satoshis()
      The value, in satoshis, of this channel as appears in the funding output
      Option_u32Z get_confirmations_required()
      The number of required confirmations on the funding transaction before the funding will be considered \"locked\".
      ChannelCounterparty get_counterparty()
      Parameters which apply to our counterparty.
      Option_u16Z get_force_close_spend_delay()
      The number of blocks (after our commitment transaction confirms) that we will need to wait until we can claim our funds after we force-close the channel.
      OutPoint get_funding_txo()
      The Channel's funding transaction output, if we've negotiated the funding transaction with our counterparty already.
      long get_inbound_capacity_msat()
      The available inbound capacity for the remote peer to send HTLCs to us.
      boolean get_is_funding_locked()
      True if the channel is confirmed, funding_locked messages have been exchanged, and the channel is not currently being shut down.
      boolean get_is_outbound()
      True if the channel was initiated (and thus funded) by us.
      boolean get_is_public()
      True if this channel is (or will be) publicly-announced.
      boolean get_is_usable()
      True if the channel is (a) confirmed and funding_locked messages have been exchanged, (b) the peer is connected, and (c) the channel is not currently negotiating a shutdown.
      long get_outbound_capacity_msat()
      The available outbound capacity for sending HTLCs to the remote peer.
      Option_u64Z get_short_channel_id()
      The position of the funding transaction in the chain.
      Option_u64Z get_unspendable_punishment_reserve()
      The value, in satoshis, that must always be held in the channel for us.
      long get_user_id()
      The user_id passed in to create_channel, or 0 if the channel was inbound.
      static ChannelDetails of​(byte[] channel_id_arg, ChannelCounterparty counterparty_arg, OutPoint funding_txo_arg, Option_u64Z short_channel_id_arg, long channel_value_satoshis_arg, Option_u64Z unspendable_punishment_reserve_arg, long user_id_arg, long outbound_capacity_msat_arg, long inbound_capacity_msat_arg, Option_u32Z confirmations_required_arg, Option_u16Z force_close_spend_delay_arg, boolean is_outbound_arg, boolean is_funding_locked_arg, boolean is_usable_arg, boolean is_public_arg)
      Constructs a new ChannelDetails given each field
      void set_channel_id​(byte[] val)
      The channel's ID (prior to funding transaction generation, this is a random 32 bytes, thereafter this is the txid of the funding transaction xor the funding transaction output).
      void set_channel_value_satoshis​(long val)
      The value, in satoshis, of this channel as appears in the funding output
      void set_confirmations_required​(Option_u32Z val)
      The number of required confirmations on the funding transaction before the funding will be considered \"locked\".
      void set_counterparty​(ChannelCounterparty val)
      Parameters which apply to our counterparty.
      void set_force_close_spend_delay​(Option_u16Z val)
      The number of blocks (after our commitment transaction confirms) that we will need to wait until we can claim our funds after we force-close the channel.
      void set_funding_txo​(OutPoint val)
      The Channel's funding transaction output, if we've negotiated the funding transaction with our counterparty already.
      void set_inbound_capacity_msat​(long val)
      The available inbound capacity for the remote peer to send HTLCs to us.
      void set_is_funding_locked​(boolean val)
      True if the channel is confirmed, funding_locked messages have been exchanged, and the channel is not currently being shut down.
      void set_is_outbound​(boolean val)
      True if the channel was initiated (and thus funded) by us.
      void set_is_public​(boolean val)
      True if this channel is (or will be) publicly-announced.
      void set_is_usable​(boolean val)
      True if the channel is (a) confirmed and funding_locked messages have been exchanged, (b) the peer is connected, and (c) the channel is not currently negotiating a shutdown.
      void set_outbound_capacity_msat​(long val)
      The available outbound capacity for sending HTLCs to the remote peer.
      void set_short_channel_id​(Option_u64Z val)
      The position of the funding transaction in the chain.
      void set_unspendable_punishment_reserve​(Option_u64Z val)
      The value, in satoshis, that must always be held in the channel for us.
      void set_user_id​(long val)
      The user_id passed in to create_channel, or 0 if the channel was inbound.
    • Method Detail

      • get_channel_id

        public byte[] get_channel_id()
        The channel's ID (prior to funding transaction generation, this is a random 32 bytes, thereafter this is the txid of the funding transaction xor the funding transaction output). Note that this means this value is *not* persistent - it can change once during the lifetime of the channel.
      • set_channel_id

        public void set_channel_id​(byte[] val)
        The channel's ID (prior to funding transaction generation, this is a random 32 bytes, thereafter this is the txid of the funding transaction xor the funding transaction output). Note that this means this value is *not* persistent - it can change once during the lifetime of the channel.
      • get_counterparty

        public ChannelCounterparty get_counterparty()
        Parameters which apply to our counterparty. See individual fields for more information.
      • set_counterparty

        public void set_counterparty​(ChannelCounterparty val)
        Parameters which apply to our counterparty. See individual fields for more information.
      • get_funding_txo

        @Nullable
        public OutPoint get_funding_txo()
        The Channel's funding transaction output, if we've negotiated the funding transaction with our counterparty already. Note that, if this has been set, `channel_id` will be equivalent to `funding_txo.unwrap().to_channel_id()`. Note that the return value (or a relevant inner pointer) may be NULL or all-0s to represent None
      • set_funding_txo

        public void set_funding_txo​(@Nullable
                                    OutPoint val)
        The Channel's funding transaction output, if we've negotiated the funding transaction with our counterparty already. Note that, if this has been set, `channel_id` will be equivalent to `funding_txo.unwrap().to_channel_id()`. Note that val (or a relevant inner pointer) may be NULL or all-0s to represent None
      • get_short_channel_id

        public Option_u64Z get_short_channel_id()
        The position of the funding transaction in the chain. None if the funding transaction has not yet been confirmed and the channel fully opened.
      • set_short_channel_id

        public void set_short_channel_id​(Option_u64Z val)
        The position of the funding transaction in the chain. None if the funding transaction has not yet been confirmed and the channel fully opened.
      • get_channel_value_satoshis

        public long get_channel_value_satoshis()
        The value, in satoshis, of this channel as appears in the funding output
      • set_channel_value_satoshis

        public void set_channel_value_satoshis​(long val)
        The value, in satoshis, of this channel as appears in the funding output
      • get_unspendable_punishment_reserve

        public Option_u64Z get_unspendable_punishment_reserve()
        The value, in satoshis, that must always be held in the channel for us. This value ensures that if we broadcast a revoked state, our counterparty can punish us by claiming at least this value on chain. This value is not included in [`outbound_capacity_msat`] as it can never be spent. This value will be `None` for outbound channels until the counterparty accepts the channel. [`outbound_capacity_msat`]: ChannelDetails::outbound_capacity_msat
      • set_unspendable_punishment_reserve

        public void set_unspendable_punishment_reserve​(Option_u64Z val)
        The value, in satoshis, that must always be held in the channel for us. This value ensures that if we broadcast a revoked state, our counterparty can punish us by claiming at least this value on chain. This value is not included in [`outbound_capacity_msat`] as it can never be spent. This value will be `None` for outbound channels until the counterparty accepts the channel. [`outbound_capacity_msat`]: ChannelDetails::outbound_capacity_msat
      • get_user_id

        public long get_user_id()
        The user_id passed in to create_channel, or 0 if the channel was inbound.
      • set_user_id

        public void set_user_id​(long val)
        The user_id passed in to create_channel, or 0 if the channel was inbound.
      • get_outbound_capacity_msat

        public long get_outbound_capacity_msat()
        The available outbound capacity for sending HTLCs to the remote peer. This does not include any pending HTLCs which are not yet fully resolved (and, thus, who's balance is not available for inclusion in new outbound HTLCs). This further does not include any pending outgoing HTLCs which are awaiting some other resolution to be sent. This value is not exact. Due to various in-flight changes, feerate changes, and our conflict-avoidance policy, exactly this amount is not likely to be spendable. However, we should be able to spend nearly this amount.
      • set_outbound_capacity_msat

        public void set_outbound_capacity_msat​(long val)
        The available outbound capacity for sending HTLCs to the remote peer. This does not include any pending HTLCs which are not yet fully resolved (and, thus, who's balance is not available for inclusion in new outbound HTLCs). This further does not include any pending outgoing HTLCs which are awaiting some other resolution to be sent. This value is not exact. Due to various in-flight changes, feerate changes, and our conflict-avoidance policy, exactly this amount is not likely to be spendable. However, we should be able to spend nearly this amount.
      • get_inbound_capacity_msat

        public long get_inbound_capacity_msat()
        The available inbound capacity for the remote peer to send HTLCs to us. This does not include any pending HTLCs which are not yet fully resolved (and, thus, who's balance is not available for inclusion in new inbound HTLCs). Note that there are some corner cases not fully handled here, so the actual available inbound capacity may be slightly higher than this. This value is not exact. Due to various in-flight changes, feerate changes, and our counterparty's conflict-avoidance policy, exactly this amount is not likely to be spendable. However, our counterparty should be able to spend nearly this amount.
      • set_inbound_capacity_msat

        public void set_inbound_capacity_msat​(long val)
        The available inbound capacity for the remote peer to send HTLCs to us. This does not include any pending HTLCs which are not yet fully resolved (and, thus, who's balance is not available for inclusion in new inbound HTLCs). Note that there are some corner cases not fully handled here, so the actual available inbound capacity may be slightly higher than this. This value is not exact. Due to various in-flight changes, feerate changes, and our counterparty's conflict-avoidance policy, exactly this amount is not likely to be spendable. However, our counterparty should be able to spend nearly this amount.
      • get_confirmations_required

        public Option_u32Z get_confirmations_required()
        The number of required confirmations on the funding transaction before the funding will be considered \"locked\". This number is selected by the channel fundee (i.e. us if [`is_outbound`] is *not* set), and can be selected for inbound channels with [`ChannelHandshakeConfig::minimum_depth`] or limited for outbound channels with [`ChannelHandshakeLimits::max_minimum_depth`]. This value will be `None` for outbound channels until the counterparty accepts the channel. [`is_outbound`]: ChannelDetails::is_outbound [`ChannelHandshakeConfig::minimum_depth`]: crate::util::config::ChannelHandshakeConfig::minimum_depth [`ChannelHandshakeLimits::max_minimum_depth`]: crate::util::config::ChannelHandshakeLimits::max_minimum_depth
      • set_confirmations_required

        public void set_confirmations_required​(Option_u32Z val)
        The number of required confirmations on the funding transaction before the funding will be considered \"locked\". This number is selected by the channel fundee (i.e. us if [`is_outbound`] is *not* set), and can be selected for inbound channels with [`ChannelHandshakeConfig::minimum_depth`] or limited for outbound channels with [`ChannelHandshakeLimits::max_minimum_depth`]. This value will be `None` for outbound channels until the counterparty accepts the channel. [`is_outbound`]: ChannelDetails::is_outbound [`ChannelHandshakeConfig::minimum_depth`]: crate::util::config::ChannelHandshakeConfig::minimum_depth [`ChannelHandshakeLimits::max_minimum_depth`]: crate::util::config::ChannelHandshakeLimits::max_minimum_depth
      • get_force_close_spend_delay

        public Option_u16Z get_force_close_spend_delay()
        The number of blocks (after our commitment transaction confirms) that we will need to wait until we can claim our funds after we force-close the channel. During this time our counterparty is allowed to punish us if we broadcasted a stale state. If our counterparty force-closes the channel and broadcasts a commitment transaction we do not have to wait any time to claim our non-HTLC-encumbered funds. This value will be `None` for outbound channels until the counterparty accepts the channel.
      • set_force_close_spend_delay

        public void set_force_close_spend_delay​(Option_u16Z val)
        The number of blocks (after our commitment transaction confirms) that we will need to wait until we can claim our funds after we force-close the channel. During this time our counterparty is allowed to punish us if we broadcasted a stale state. If our counterparty force-closes the channel and broadcasts a commitment transaction we do not have to wait any time to claim our non-HTLC-encumbered funds. This value will be `None` for outbound channels until the counterparty accepts the channel.
      • get_is_outbound

        public boolean get_is_outbound()
        True if the channel was initiated (and thus funded) by us.
      • set_is_outbound

        public void set_is_outbound​(boolean val)
        True if the channel was initiated (and thus funded) by us.
      • get_is_funding_locked

        public boolean get_is_funding_locked()
        True if the channel is confirmed, funding_locked messages have been exchanged, and the channel is not currently being shut down. `funding_locked` message exchange implies the required confirmation count has been reached (and we were connected to the peer at some point after the funding transaction received enough confirmations). The required confirmation count is provided in [`confirmations_required`]. [`confirmations_required`]: ChannelDetails::confirmations_required
      • set_is_funding_locked

        public void set_is_funding_locked​(boolean val)
        True if the channel is confirmed, funding_locked messages have been exchanged, and the channel is not currently being shut down. `funding_locked` message exchange implies the required confirmation count has been reached (and we were connected to the peer at some point after the funding transaction received enough confirmations). The required confirmation count is provided in [`confirmations_required`]. [`confirmations_required`]: ChannelDetails::confirmations_required
      • get_is_usable

        public boolean get_is_usable()
        True if the channel is (a) confirmed and funding_locked messages have been exchanged, (b) the peer is connected, and (c) the channel is not currently negotiating a shutdown. This is a strict superset of `is_funding_locked`.
      • set_is_usable

        public void set_is_usable​(boolean val)
        True if the channel is (a) confirmed and funding_locked messages have been exchanged, (b) the peer is connected, and (c) the channel is not currently negotiating a shutdown. This is a strict superset of `is_funding_locked`.
      • get_is_public

        public boolean get_is_public()
        True if this channel is (or will be) publicly-announced.
      • set_is_public

        public void set_is_public​(boolean val)
        True if this channel is (or will be) publicly-announced.
      • of

        public static ChannelDetails of​(byte[] channel_id_arg,
                                        ChannelCounterparty counterparty_arg,
                                        OutPoint funding_txo_arg,
                                        Option_u64Z short_channel_id_arg,
                                        long channel_value_satoshis_arg,
                                        Option_u64Z unspendable_punishment_reserve_arg,
                                        long user_id_arg,
                                        long outbound_capacity_msat_arg,
                                        long inbound_capacity_msat_arg,
                                        Option_u32Z confirmations_required_arg,
                                        Option_u16Z force_close_spend_delay_arg,
                                        boolean is_outbound_arg,
                                        boolean is_funding_locked_arg,
                                        boolean is_usable_arg,
                                        boolean is_public_arg)
        Constructs a new ChannelDetails given each field