Package org.ldk.structs
Class NetGraphMsgHandler
- java.lang.Object
-
- org.ldk.structs.NetGraphMsgHandler
-
public class NetGraphMsgHandler 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. Serves as an [`EventHandler`] for applying updates from [`Event::PaymentPathFailed`] to the [`NetworkGraph`].
-
-
Method Summary
All Methods Static Methods Instance Methods Concrete Methods Modifier and Type Method Description void
add_chain_access(Option_AccessZ chain_access)
Adds a provider used to check new announcements.EventHandler
as_EventHandler()
Constructs a new EventHandler which calls the relevant methods on this_arg.MessageSendEventsProvider
as_MessageSendEventsProvider()
Constructs a new MessageSendEventsProvider which calls the relevant methods on this_arg.RoutingMessageHandler
as_RoutingMessageHandler()
Constructs a new RoutingMessageHandler which calls the relevant methods on this_arg.protected void
finalize()
NetworkGraph
get_network_graph()
Representation of the payment channel networkstatic NetGraphMsgHandler
of(byte[] network_graph_genesis_hash, Option_AccessZ chain_access, Logger logger)
Creates a new tracker of the actual state of the network of channels and nodes, assuming an existing Network Graph.void
set_network_graph(byte[] val_genesis_hash)
Representation of the payment channel network
-
-
-
Method Detail
-
finalize
protected void finalize() throws Throwable
-
as_EventHandler
public EventHandler as_EventHandler()
Constructs a new EventHandler which calls the relevant methods on this_arg. This copies the `inner` pointer in this_arg and thus the returned EventHandler must be freed before this_arg is
-
get_network_graph
public NetworkGraph get_network_graph()
Representation of the payment channel network
-
set_network_graph
public void set_network_graph(byte[] val_genesis_hash)
Representation of the payment channel network
-
of
public static NetGraphMsgHandler of(byte[] network_graph_genesis_hash, Option_AccessZ chain_access, Logger logger)
Creates a new tracker of the actual state of the network of channels and nodes, assuming an existing Network Graph. Chain monitor is used to make sure announced channels exist on-chain, channel data is correct, and that the announcement is signed with channel owners' keys.
-
add_chain_access
public void add_chain_access(Option_AccessZ chain_access)
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
-
-