Class CustomOnionMessageHandler


  • public class CustomOnionMessageHandler
    extends Object
    Handler for custom onion messages. If you are using [`SimpleArcOnionMessenger`], [`SimpleRefOnionMessenger`], or prefer to ignore inbound custom onion messages, [`IgnoringMessageHandler`] must be provided to [`OnionMessenger::new`]. Otherwise, a custom implementation of this trait must be provided, with [`CustomMessage`] specifying the supported message types. See [`OnionMessenger`] for example usage. [`IgnoringMessageHandler`]: crate::ln::peer_handler::IgnoringMessageHandler [`CustomMessage`]: Self::CustomMessage
    • Method Detail

      • destroy

        public void destroy()
        Destroys the object, freeing associated resources. After this call, any access to this object may result in a SEGFAULT or worse. You should generally NEVER call this method. You should let the garbage collector do this for you when it finalizes objects. However, it may be useful for types which represent locks and should be closed immediately to avoid holding locks until the GC runs.
      • handle_custom_message

        public void handle_custom_message​(CustomOnionMessageContents msg)
        Called with the custom message that was received.