Package org.ldk.enums

Enum FailureCode

  • All Implemented Interfaces:
    Serializable, Comparable<FailureCode>

    public enum FailureCode
    extends Enum<FailureCode>
    This enum is used to specify which error data to send to peers when failing back an HTLC using [`ChannelManager::fail_htlc_backwards_with_reason`]. For more info on failure codes, see .
    • Enum Constant Detail

      • LDKFailureCode_TemporaryNodeFailure

        public static final FailureCode LDKFailureCode_TemporaryNodeFailure
        We had a temporary error processing the payment. Useful if no other error codes fit and you want to indicate that the payer may want to retry.
      • LDKFailureCode_RequiredNodeFeatureMissing

        public static final FailureCode LDKFailureCode_RequiredNodeFeatureMissing
        We have a required feature which was not in this onion. For example, you may require some additional metadata that was not provided with this payment.
      • LDKFailureCode_IncorrectOrUnknownPaymentDetails

        public static final FailureCode LDKFailureCode_IncorrectOrUnknownPaymentDetails
        You may wish to use this when a `payment_preimage` is unknown, or the CLTV expiry of the HTLC is too close to the current block height for safe handling. Using this failure code in [`ChannelManager::fail_htlc_backwards_with_reason`] is equivalent to calling [`ChannelManager::fail_htlc_backwards`].
    • Method Detail

      • values

        public static FailureCode[] values()
        Returns an array containing the constants of this enum type, in the order they are declared. This method may be used to iterate over the constants as follows:
        for (FailureCode c : FailureCode.values())
            System.out.println(c);
        
        Returns:
        an array containing the constants of this enum type, in the order they are declared
      • valueOf

        public static FailureCode valueOf​(String name)
        Returns the enum constant of this type with the specified name. The string must match exactly an identifier used to declare an enum constant in this type. (Extraneous whitespace characters are not permitted.)
        Parameters:
        name - the name of the enum constant to be returned.
        Returns:
        the enum constant with the specified name
        Throws:
        IllegalArgumentException - if this enum type has no constant with the specified name
        NullPointerException - if the argument is null