Struct lightning::routing::network_graph::NetworkGraph [−][src]
pub struct NetworkGraph { /* fields omitted */ }
Expand description
Represents the network as nodes and channels between them
Implementations
Creates a new, empty, network graph.
Returns a read-only view of the network graph.
pub fn update_node_from_announcement<T: Verification>(
&self,
msg: &NodeAnnouncement,
secp_ctx: &Secp256k1<T>
) -> Result<(), LightningError>
pub fn update_node_from_announcement<T: Verification>(
&self,
msg: &NodeAnnouncement,
secp_ctx: &Secp256k1<T>
) -> Result<(), LightningError>
For an already known node (from channel announcements), update its stored properties from a given node announcement.
You probably don’t want to call this directly, instead relying on a NetGraphMsgHandler’s RoutingMessageHandler implementation to call it indirectly. This may be useful to accept routing messages from a source using a protocol other than the lightning P2P protocol.
pub fn update_node_from_unsigned_announcement(
&self,
msg: &UnsignedNodeAnnouncement
) -> Result<(), LightningError>
pub fn update_node_from_unsigned_announcement(
&self,
msg: &UnsignedNodeAnnouncement
) -> Result<(), LightningError>
For an already known node (from channel announcements), update its stored properties from a given node announcement without verifying the associated signatures. Because we aren’t given the associated signatures here we cannot relay the node announcement to any of our peers.
pub fn update_channel_from_announcement<T: Verification, C: Deref>(
&self,
msg: &ChannelAnnouncement,
chain_access: &Option<C>,
secp_ctx: &Secp256k1<T>
) -> Result<(), LightningError> where
C::Target: Access,
pub fn update_channel_from_announcement<T: Verification, C: Deref>(
&self,
msg: &ChannelAnnouncement,
chain_access: &Option<C>,
secp_ctx: &Secp256k1<T>
) -> Result<(), LightningError> where
C::Target: Access,
Store or update channel info from a channel announcement.
You probably don’t want to call this directly, instead relying on a NetGraphMsgHandler’s RoutingMessageHandler implementation to call it indirectly. This may be useful to accept routing messages from a source using a protocol other than the lightning P2P protocol.
If a chain::Access
object is provided via chain_access
, it will be called to verify
the corresponding UTXO exists on chain and is correctly-formatted.
pub fn update_channel_from_unsigned_announcement<C: Deref>(
&self,
msg: &UnsignedChannelAnnouncement,
chain_access: &Option<C>
) -> Result<(), LightningError> where
C::Target: Access,
pub fn update_channel_from_unsigned_announcement<C: Deref>(
&self,
msg: &UnsignedChannelAnnouncement,
chain_access: &Option<C>
) -> Result<(), LightningError> where
C::Target: Access,
Store or update channel info from a channel announcement without verifying the associated signatures. Because we aren’t given the associated signatures here we cannot relay the channel announcement to any of our peers.
If a chain::Access
object is provided via chain_access
, it will be called to verify
the corresponding UTXO exists on chain and is correctly-formatted.
Close a channel if a corresponding HTLC fail was sent. If permanent, removes a channel from the local storage. May cause the removal of nodes too, if this was their last channel. If not permanent, makes channels unavailable for routing.
Marks a node in the graph as failed.
pub fn update_channel<T: Verification>(
&self,
msg: &ChannelUpdate,
secp_ctx: &Secp256k1<T>
) -> Result<(), LightningError>
pub fn update_channel<T: Verification>(
&self,
msg: &ChannelUpdate,
secp_ctx: &Secp256k1<T>
) -> Result<(), LightningError>
For an already known (from announcement) channel, update info about one of the directions of the channel.
You probably don’t want to call this directly, instead relying on a NetGraphMsgHandler’s RoutingMessageHandler implementation to call it indirectly. This may be useful to accept routing messages from a source using a protocol other than the lightning P2P protocol.
pub fn update_channel_unsigned(
&self,
msg: &UnsignedChannelUpdate
) -> Result<(), LightningError>
pub fn update_channel_unsigned(
&self,
msg: &UnsignedChannelUpdate
) -> Result<(), LightningError>
For an already known (from announcement) channel, update info about one of the directions of the channel without verifying the associated signatures. Because we aren’t given the associated signatures here we cannot relay the channel update to any of our peers.
Trait Implementations
Reads a Self in from the given Read
Writes self out to the given Writer
Writes self out to a Vec
Writes self out to a Vec
Gets the length of this object after it has been serialized. This can be overridden to optimize cases where we prepend an object with its length. Read more
Auto Trait Implementations
impl RefUnwindSafe for NetworkGraph
impl Send for NetworkGraph
impl Sync for NetworkGraph
impl Unpin for NetworkGraph
impl UnwindSafe for NetworkGraph
Blanket Implementations
Mutably borrows from an owned value. Read more