Class P2PGossipSync


  • public class P2PGossipSync
    extends Object
    Receives and validates network updates from peers, stores authentic and relevant data as a network graph. This network graph is then used for routing payments. Provides interface to help with initial routing sync by serving historical announcements.
    • Method Detail

      • of

        public static P2PGossipSync of​(NetworkGraph network_graph,
                                       Option_UtxoLookupZ utxo_lookup,
                                       Logger logger)
        Creates a new tracker of the actual state of the network of channels and nodes, assuming an existing [`NetworkGraph`]. UTXO lookup is used to make sure announced channels exist on-chain, channel data is correct, and the announcement is signed with channel owners' keys.
      • add_utxo_lookup

        public void add_utxo_lookup​(Option_UtxoLookupZ utxo_lookup)
        Adds a provider used to check new announcements. Does not affect existing announcements unless they are updated. Add, update or remove the provider would replace the current one.
      • as_RoutingMessageHandler

        public RoutingMessageHandler as_RoutingMessageHandler()
        Constructs a new RoutingMessageHandler which calls the relevant methods on this_arg. This copies the `inner` pointer in this_arg and thus the returned RoutingMessageHandler must be freed before this_arg is
      • as_MessageSendEventsProvider

        public MessageSendEventsProvider as_MessageSendEventsProvider()
        Constructs a new MessageSendEventsProvider which calls the relevant methods on this_arg. This copies the `inner` pointer in this_arg and thus the returned MessageSendEventsProvider must be freed before this_arg is