Class ChannelTypeFeatures


  • public class ChannelTypeFeatures
    extends Object
    Features used within the channel_type field in an OpenChannel message. A channel is always of some known \"type\", describing the transaction formats used and the exact semantics of our interaction with our peer. Note that because a channel is a specific type which is proposed by the opener and accepted by the counterparty, only required features are allowed here. This is serialized differently from other feature types - it is not prefixed by a length, and thus must only appear inside a TLV where its length is known in advance.
    • Method Detail

      • eq

        public boolean eq​(ChannelTypeFeatures b)
        Checks if two ChannelTypeFeaturess 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.
      • empty

        public static ChannelTypeFeatures empty()
        Create a blank Features with no features set
      • requires_unknown_bits_from

        public boolean requires_unknown_bits_from​(ChannelTypeFeatures other)
        Returns true if this `Features` object contains required features unknown by `other`.
      • requires_unknown_bits

        public boolean requires_unknown_bits()
        Returns true if this `Features` object contains unknown feature flags which are set as \"required\".
      • set_required_feature_bit

        public Result_NoneNoneZ set_required_feature_bit​(long bit)
        Sets a required feature bit. Errors if `bit` is outside the feature range as defined by [BOLT 9]. Note: Required bits are even. If an odd bit is given, then the corresponding even bit will be set instead (i.e., `bit - 1`). [BOLT 9]: https://github.com/lightning/bolts/blob/master/09-features.md
      • set_optional_feature_bit

        public Result_NoneNoneZ set_optional_feature_bit​(long bit)
        Sets an optional feature bit. Errors if `bit` is outside the feature range as defined by [BOLT 9]. Note: Optional bits are odd. If an even bit is given, then the corresponding odd bit will be set instead (i.e., `bit + 1`). [BOLT 9]: https://github.com/lightning/bolts/blob/master/09-features.md
      • set_required_custom_bit

        public Result_NoneNoneZ set_required_custom_bit​(long bit)
        Sets a required custom feature bit. Errors if `bit` is outside the custom range as defined by [bLIP 2] or if it is a known `T` feature. Note: Required bits are even. If an odd bit is given, then the corresponding even bit will be set instead (i.e., `bit - 1`). [bLIP 2]: https://github.com/lightning/blips/blob/master/blip-0002.md#feature-bits
      • set_optional_custom_bit

        public Result_NoneNoneZ set_optional_custom_bit​(long bit)
        Sets an optional custom feature bit. Errors if `bit` is outside the custom range as defined by [bLIP 2] or if it is a known `T` feature. Note: Optional bits are odd. If an even bit is given, then the corresponding odd bit will be set instead (i.e., `bit + 1`). [bLIP 2]: https://github.com/lightning/blips/blob/master/blip-0002.md#feature-bits
      • write

        public byte[] write()
        Serialize the ChannelTypeFeatures object into a byte array which can be read by ChannelTypeFeatures_read
      • set_static_remote_key_optional

        public void set_static_remote_key_optional()
        Set this feature as optional.
      • set_static_remote_key_required

        public void set_static_remote_key_required()
        Set this feature as required.
      • supports_static_remote_key

        public boolean supports_static_remote_key()
        Checks if this feature is supported.
      • requires_static_remote_key

        public boolean requires_static_remote_key()
        Checks if this feature is required.
      • set_anchors_nonzero_fee_htlc_tx_optional

        public void set_anchors_nonzero_fee_htlc_tx_optional()
        Set this feature as optional.
      • set_anchors_nonzero_fee_htlc_tx_required

        public void set_anchors_nonzero_fee_htlc_tx_required()
        Set this feature as required.
      • supports_anchors_nonzero_fee_htlc_tx

        public boolean supports_anchors_nonzero_fee_htlc_tx()
        Checks if this feature is supported.
      • requires_anchors_nonzero_fee_htlc_tx

        public boolean requires_anchors_nonzero_fee_htlc_tx()
        Checks if this feature is required.
      • set_anchors_zero_fee_htlc_tx_optional

        public void set_anchors_zero_fee_htlc_tx_optional()
        Set this feature as optional.
      • set_anchors_zero_fee_htlc_tx_required

        public void set_anchors_zero_fee_htlc_tx_required()
        Set this feature as required.
      • supports_anchors_zero_fee_htlc_tx

        public boolean supports_anchors_zero_fee_htlc_tx()
        Checks if this feature is supported.
      • requires_anchors_zero_fee_htlc_tx

        public boolean requires_anchors_zero_fee_htlc_tx()
        Checks if this feature is required.
      • set_taproot_optional

        public void set_taproot_optional()
        Set this feature as optional.
      • set_taproot_required

        public void set_taproot_required()
        Set this feature as required.
      • supports_taproot

        public boolean supports_taproot()
        Checks if this feature is supported.
      • requires_taproot

        public boolean requires_taproot()
        Checks if this feature is required.
      • set_scid_privacy_optional

        public void set_scid_privacy_optional()
        Set this feature as optional.
      • set_scid_privacy_required

        public void set_scid_privacy_required()
        Set this feature as required.
      • supports_scid_privacy

        public boolean supports_scid_privacy()
        Checks if this feature is supported.
      • requires_scid_privacy

        public boolean requires_scid_privacy()
        Checks if this feature is required.
      • set_zero_conf_optional

        public void set_zero_conf_optional()
        Set this feature as optional.
      • set_zero_conf_required

        public void set_zero_conf_required()
        Set this feature as required.
      • supports_zero_conf

        public boolean supports_zero_conf()
        Checks if this feature is supported.
      • requires_zero_conf

        public boolean requires_zero_conf()
        Checks if this feature is required.