Interface OnionMessageHandler.OnionMessageHandlerInterface

  • Enclosing class:
    OnionMessageHandler

    public static interface OnionMessageHandler.OnionMessageHandlerInterface
    • Method Detail

      • handle_onion_message

        void handle_onion_message​(byte[] peer_node_id,
                                  OnionMessage msg)
        Handle an incoming onion_message message from the given peer.
      • peer_connected

        void peer_connected​(byte[] their_node_id,
                            Init init)
        Called when a connection is established with a peer. Can be used to track which peers advertise onion message support and are online.
      • peer_disconnected

        void peer_disconnected​(byte[] their_node_id,
                               boolean no_connection_possible)
        Indicates a connection to the peer failed/an existing connection was lost. Allows handlers to drop and refuse to forward onion messages to this peer.
      • provided_node_features

        NodeFeatures provided_node_features()
        Gets the node feature flags which this handler itself supports. All available handlers are queried similarly and their feature flags are OR'd together to form the [`NodeFeatures`] which are broadcasted in our [`NodeAnnouncement`] message.
      • provided_init_features

        InitFeatures provided_init_features​(byte[] their_node_id)
        Gets the init feature flags which should be sent to the given peer. All available handlers are queried similarly and their feature flags are OR'd together to form the [`InitFeatures`] which are sent in our [`Init`] message. Note that this method is called before [`Self::peer_connected`].