Class ErrorMessage


  • public class ErrorMessage
    extends Object
    An [`error`] message to be sent to or received from a peer. [`error`]: https://github.com/lightning/bolts/blob/master/01-messaging.md#the-error-and-warning-messages
    • Method Detail

      • get_channel_id

        public byte[] get_channel_id()
        The channel ID involved in the error. All-0s indicates a general error unrelated to a specific channel, after which all channels with the sending peer should be closed.
      • set_channel_id

        public void set_channel_id​(byte[] val)
        The channel ID involved in the error. All-0s indicates a general error unrelated to a specific channel, after which all channels with the sending peer should be closed.
      • get_data

        public String get_data()
        A possibly human-readable error description. The string should be sanitized before it is used (e.g., emitted to logs or printed to `stdout`). Otherwise, a well crafted error message may trigger a security vulnerability in the terminal emulator or the logging subsystem.
      • set_data

        public void set_data​(String val)
        A possibly human-readable error description. The string should be sanitized before it is used (e.g., emitted to logs or printed to `stdout`). Otherwise, a well crafted error message may trigger a security vulnerability in the terminal emulator or the logging subsystem.
      • of

        public static ErrorMessage of​(byte[] channel_id_arg,
                                      String data_arg)
        Constructs a new ErrorMessage given each field
      • eq

        public boolean eq​(ErrorMessage b)
        Checks if two ErrorMessages 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.
      • write

        public byte[] write()
        Serialize the ErrorMessage object into a byte array which can be read by ErrorMessage_read