breez_sdk_liquid::lightning::ln::peer_handler

Struct IgnoringMessageHandler

pub struct IgnoringMessageHandler {}
Expand description

A dummy struct which implements RoutingMessageHandler without storing any routing information or doing any processing. You can provide one of these as the route_handler in a MessageHandler.

Trait Implementations§

§

impl CustomMessageHandler for IgnoringMessageHandler

§

fn handle_custom_message( &self, _msg: Infallible, _sender_node_id: &PublicKey, ) -> Result<(), LightningError>

Handles the given message sent from sender_node_id, possibly producing messages for CustomMessageHandler::get_and_clear_pending_msg to return and thus for PeerManager to send.
§

fn get_and_clear_pending_msg( &self, ) -> Vec<(PublicKey, <IgnoringMessageHandler as CustomMessageReader>::CustomMessage)>

Returns the list of pending messages that were generated by the handler, clearing the list in the process. Each message is paired with the node id of the intended recipient. If no connection to the node exists, then the message is simply not sent.
§

fn provided_node_features(&self) -> Features<NodeContext>

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.
§

fn provided_init_features( &self, _their_node_id: &PublicKey, ) -> Features<InitContext>

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.
§

impl CustomMessageReader for IgnoringMessageHandler

§

type CustomMessage = Infallible

The type of the message decoded by the implementation.
§

fn read<R>( &self, _message_type: u16, _buffer: &mut R, ) -> Result<Option<<IgnoringMessageHandler as CustomMessageReader>::CustomMessage>, DecodeError>
where R: Read,

Decodes a custom message to CustomMessageType. If the given message type is known to the implementation and the message could be decoded, must return Ok(Some(message)). If the message type is unknown to the implementation, must return Ok(None). If a decoding error occur, must return Err(DecodeError::X) where X details the encountered error.
§

impl CustomOnionMessageHandler for IgnoringMessageHandler

§

type CustomMessage = Infallible

The message known to the handler. To support multiple message types, you may want to make this an enum with a variant for each supported message.
§

fn handle_custom_message(&self, _msg: Infallible) -> Option<Infallible>

Called with the custom message that was received, returning a response to send, if any. Read more
§

fn read_custom_message<R>( &self, _msg_type: u64, _buffer: &mut R, ) -> Result<Option<Infallible>, DecodeError>

Read a custom message of type message_type from buffer, returning Ok(None) if the message type is unknown.
§

fn release_pending_custom_messages( &self, ) -> Vec<PendingOnionMessage<Infallible>>

Releases any Self::CustomMessages that need to be sent. Read more
§

impl Deref for IgnoringMessageHandler

§

type Target = IgnoringMessageHandler

The resulting type after dereferencing.
§

fn deref(&self) -> &IgnoringMessageHandler

Dereferences the value.
§

impl MessageSendEventsProvider for IgnoringMessageHandler

§

fn get_and_clear_pending_msg_events(&self) -> Vec<MessageSendEvent>

Gets the list of pending events which were generated by previous actions, clearing the list in the process.
§

impl OffersMessageHandler for IgnoringMessageHandler

§

fn handle_message(&self, _msg: OffersMessage) -> Option<OffersMessage>

Handles the given message by either responding with an Bolt12Invoice, sending a payment, or replying with an error. Read more
§

fn release_pending_messages(&self) -> Vec<PendingOnionMessage<OffersMessage>>

Releases any OffersMessages that need to be sent. Read more
§

impl OnionMessageHandler for IgnoringMessageHandler

§

fn handle_onion_message(&self, _their_node_id: &PublicKey, _msg: &OnionMessage)

Handle an incoming onion_message message from the given peer.
§

fn next_onion_message_for_peer( &self, _peer_node_id: PublicKey, ) -> Option<OnionMessage>

Returns the next pending onion message for the peer with the given node id.
§

fn peer_connected( &self, _their_node_id: &PublicKey, _init: &Init, _inbound: bool, ) -> Result<(), ()>

Called when a connection is established with a peer. Can be used to track which peers advertise onion message support and are online. Read more
§

fn peer_disconnected(&self, _their_node_id: &PublicKey)

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.
§

fn provided_node_features(&self) -> Features<NodeContext>

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.
§

fn provided_init_features( &self, _their_node_id: &PublicKey, ) -> Features<InitContext>

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. Read more
§

impl RoutingMessageHandler for IgnoringMessageHandler

§

fn handle_node_announcement( &self, _msg: &NodeAnnouncement, ) -> Result<bool, LightningError>

Handle an incoming node_announcement message, returning true if it should be forwarded on, false or returning an Err otherwise.
§

fn handle_channel_announcement( &self, _msg: &ChannelAnnouncement, ) -> Result<bool, LightningError>

Handle a channel_announcement message, returning true if it should be forwarded on, false or returning an Err otherwise.
§

fn handle_channel_update( &self, _msg: &ChannelUpdate, ) -> Result<bool, LightningError>

Handle an incoming channel_update message, returning true if it should be forwarded on, false or returning an Err otherwise.
§

fn get_next_channel_announcement( &self, _starting_point: u64, ) -> Option<(ChannelAnnouncement, Option<ChannelUpdate>, Option<ChannelUpdate>)>

Gets channel announcements and updates required to dump our routing table to a remote node, starting at the short_channel_id indicated by starting_point and including announcements for a single channel.
§

fn get_next_node_announcement( &self, _starting_point: Option<&NodeId>, ) -> Option<NodeAnnouncement>

Gets a node announcement required to dump our routing table to a remote node, starting at the node after the provided pubkey and including up to one announcement immediately higher (as defined by <PublicKey as Ord>::cmp) than starting_point. If None is provided for starting_point, we start at the first node.
§

fn peer_connected( &self, _their_node_id: &PublicKey, _init: &Init, _inbound: bool, ) -> Result<(), ()>

Called when a connection is established with a peer. This can be used to perform routing table synchronization using a strategy defined by the implementor. Read more
§

fn handle_reply_channel_range( &self, _their_node_id: &PublicKey, _msg: ReplyChannelRange, ) -> Result<(), LightningError>

Handles the reply of a query we initiated to learn about channels for a given range of blocks. We can expect to receive one or more replies to a single query.
§

fn handle_reply_short_channel_ids_end( &self, _their_node_id: &PublicKey, _msg: ReplyShortChannelIdsEnd, ) -> Result<(), LightningError>

Handles the reply of a query we initiated asking for routing gossip messages for a list of channels. We should receive this message when a node has completed its best effort to send us the pertaining routing gossip messages.
§

fn handle_query_channel_range( &self, _their_node_id: &PublicKey, _msg: QueryChannelRange, ) -> Result<(), LightningError>

Handles when a peer asks us to send a list of short_channel_ids for the requested range of blocks.
§

fn handle_query_short_channel_ids( &self, _their_node_id: &PublicKey, _msg: QueryShortChannelIds, ) -> Result<(), LightningError>

Handles when a peer asks us to send routing gossip messages for a list of short_channel_ids.
§

fn provided_node_features(&self) -> Features<NodeContext>

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.
§

fn provided_init_features( &self, _their_node_id: &PublicKey, ) -> Features<InitContext>

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. Read more
§

fn processing_queue_high(&self) -> bool

Indicates that there are a large number of ChannelAnnouncement (or other) messages pending some async action. While there is no guarantee of the rate of future messages, the caller should seek to reduce the rate of new gossip messages handled, especially ChannelAnnouncements.

Auto Trait Implementations§

Blanket Implementations§

source§

impl<T> Any for T
where T: 'static + ?Sized,

source§

fn type_id(&self) -> TypeId

Gets the TypeId of self. Read more
§

impl<'a, T, E> AsTaggedExplicit<'a, E> for T
where T: 'a,

§

fn explicit(self, class: Class, tag: u32) -> TaggedParser<'a, Explicit, Self, E>

§

impl<'a, T, E> AsTaggedImplicit<'a, E> for T
where T: 'a,

§

fn implicit( self, class: Class, constructed: bool, tag: u32, ) -> TaggedParser<'a, Implicit, Self, E>

source§

impl<T> Borrow<T> for T
where T: ?Sized,

source§

fn borrow(&self) -> &T

Immutably borrows from an owned value. Read more
source§

impl<T> BorrowMut<T> for T
where T: ?Sized,

source§

fn borrow_mut(&mut self) -> &mut T

Mutably borrows from an owned value. Read more
source§

impl<T> From<T> for T

source§

fn from(t: T) -> T

Returns the argument unchanged.

§

impl<T> Instrument for T

§

fn instrument(self, span: Span) -> Instrumented<Self>

Instruments this type with the provided [Span], returning an Instrumented wrapper. Read more
§

fn in_current_span(self) -> Instrumented<Self>

Instruments this type with the current Span, returning an Instrumented wrapper. Read more
source§

impl<T, U> Into<U> for T
where U: From<T>,

source§

fn into(self) -> U

Calls U::from(self).

That is, this conversion is whatever the implementation of From<T> for U chooses to do.

source§

impl<T> IntoRequest<T> for T

source§

fn into_request(self) -> Request<T>

Wrap the input message T in a tonic::Request
source§

impl<T> Same for T

source§

type Output = T

Should always be Self
§

impl<S, T> ScoreLookUp for T
where S: ScoreLookUp, T: Deref<Target = S>,

§

type ScoreParams = <S as ScoreLookUp>::ScoreParams

A configurable type which should contain various passed-in parameters for configuring the scorer, on a per-routefinding-call basis through to the scorer methods, which are used to determine the parameters for the suitability of channels for use.
§

fn channel_penalty_msat( &self, short_channel_id: u64, source: &NodeId, target: &NodeId, usage: ChannelUsage, score_params: &<T as ScoreLookUp>::ScoreParams, ) -> u64

Returns the fee in msats willing to be paid to avoid routing send_amt_msat through the given channel in the direction from source to target. Read more
§

impl<S, T> ScoreLookUp for T
where S: ScoreLookUp, T: Deref<Target = S>,

§

type ScoreParams = <S as ScoreLookUp>::ScoreParams

A configurable type which should contain various passed-in parameters for configuring the scorer, on a per-routefinding-call basis through to the scorer methods, which are used to determine the parameters for the suitability of channels for use.
§

fn channel_penalty_msat( &self, candidate: &CandidateRouteHop<'_>, usage: ChannelUsage, score_params: &<T as ScoreLookUp>::ScoreParams, ) -> u64

Returns the fee in msats willing to be paid to avoid routing send_amt_msat through the given channel in the direction from source to target. Read more
§

impl<S, T> ScoreLookUp for T
where S: ScoreLookUp, T: Deref<Target = S>,

§

type ScoreParams = <S as ScoreLookUp>::ScoreParams

A configurable type which should contain various passed-in parameters for configuring the scorer, on a per-routefinding-call basis through to the scorer methods, which are used to determine the parameters for the suitability of channels for use.
§

fn channel_penalty_msat( &self, candidate: &CandidateRouteHop<'_>, usage: ChannelUsage, score_params: &<T as ScoreLookUp>::ScoreParams, ) -> u64

Returns the fee in msats willing to be paid to avoid routing send_amt_msat through the given channel in the direction from source to target. Read more
source§

impl<T, U> TryFrom<U> for T
where U: Into<T>,

source§

type Error = Infallible

The type returned in the event of a conversion error.
source§

fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>

Performs the conversion.
source§

impl<T, U> TryInto<U> for T
where U: TryFrom<T>,

source§

type Error = <U as TryFrom<T>>::Error

The type returned in the event of a conversion error.
source§

fn try_into(self) -> Result<U, <U as TryFrom<T>>::Error>

Performs the conversion.
§

impl<V, T> VZip<V> for T
where V: MultiLane<T>,

§

fn vzip(self) -> V

§

impl<T> WithSubscriber for T

§

fn with_subscriber<S>(self, subscriber: S) -> WithDispatch<Self>
where S: Into<Dispatch>,

Attaches the provided Subscriber to this type, returning a [WithDispatch] wrapper. Read more
§

fn with_current_subscriber(self) -> WithDispatch<Self>

Attaches the current default Subscriber to this type, returning a [WithDispatch] wrapper. Read more
§

impl<T> DartSafe for T

§

impl<T> Formattable for T
where T: Deref, <T as Deref>::Target: Formattable,

§

impl<T> Parsable for T
where T: Deref, <T as Deref>::Target: Parsable,

§

impl<T> TaskRetFutTrait for T
where T: Send,