Class ChannelHandshakeConfig


  • public class ChannelHandshakeConfig
    extends Object
    Configuration we set when applicable. Default::default() provides sane defaults.
    • Method Detail

      • get_minimum_depth

        public int get_minimum_depth()
        Confirmations we will wait for before considering the channel locked in. Applied only for inbound channels (see ChannelHandshakeLimits::max_minimum_depth for the equivalent limit applied to outbound channels). Default value: 6.
      • set_minimum_depth

        public void set_minimum_depth​(int val)
        Confirmations we will wait for before considering the channel locked in. Applied only for inbound channels (see ChannelHandshakeLimits::max_minimum_depth for the equivalent limit applied to outbound channels). Default value: 6.
      • get_our_to_self_delay

        public short get_our_to_self_delay()
        Set to the number of blocks we require our counterparty to wait to claim their money (ie the number of blocks we have to punish our counterparty if they broadcast a revoked transaction). This is one of the main parameters of our security model. We (or one of our watchtowers) MUST be online to check for revoked transactions on-chain at least once every our_to_self_delay blocks (minus some margin to allow us enough time to broadcast and confirm a transaction, possibly with time in between to RBF the spending transaction). Meanwhile, asking for a too high delay, we bother peer to freeze funds for nothing in case of an honest unilateral channel close, which implicitly decrease the economic value of our channel. Default value: [`BREAKDOWN_TIMEOUT`], we enforce it as a minimum at channel opening so you can tweak config to ask for more security, not less.
      • set_our_to_self_delay

        public void set_our_to_self_delay​(short val)
        Set to the number of blocks we require our counterparty to wait to claim their money (ie the number of blocks we have to punish our counterparty if they broadcast a revoked transaction). This is one of the main parameters of our security model. We (or one of our watchtowers) MUST be online to check for revoked transactions on-chain at least once every our_to_self_delay blocks (minus some margin to allow us enough time to broadcast and confirm a transaction, possibly with time in between to RBF the spending transaction). Meanwhile, asking for a too high delay, we bother peer to freeze funds for nothing in case of an honest unilateral channel close, which implicitly decrease the economic value of our channel. Default value: [`BREAKDOWN_TIMEOUT`], we enforce it as a minimum at channel opening so you can tweak config to ask for more security, not less.
      • get_our_htlc_minimum_msat

        public long get_our_htlc_minimum_msat()
        Set to the smallest value HTLC we will accept to process. This value is sent to our counterparty on channel-open and we close the channel any time our counterparty misbehaves by sending us an HTLC with a value smaller than this. Default value: 1. If the value is less than 1, it is ignored and set to 1, as is required by the protocol.
      • set_our_htlc_minimum_msat

        public void set_our_htlc_minimum_msat​(long val)
        Set to the smallest value HTLC we will accept to process. This value is sent to our counterparty on channel-open and we close the channel any time our counterparty misbehaves by sending us an HTLC with a value smaller than this. Default value: 1. If the value is less than 1, it is ignored and set to 1, as is required by the protocol.
      • of

        public static ChannelHandshakeConfig of​(int minimum_depth_arg,
                                                short our_to_self_delay_arg,
                                                long our_htlc_minimum_msat_arg)
        Constructs a new ChannelHandshakeConfig given each field
      • with_default

        public static ChannelHandshakeConfig with_default()
        Creates a "default" ChannelHandshakeConfig. See struct and individual field documentaiton for details on which values are used.