Struct IgnoringMessageHandler

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

Source§

impl AsyncPaymentsMessageHandler for IgnoringMessageHandler

Source§

fn handle_held_htlc_available( &self, _message: HeldHtlcAvailable, _responder: Option<Responder>, ) -> Option<(ReleaseHeldHtlc, ResponseInstruction)>

Handle a HeldHtlcAvailable message. A ReleaseHeldHtlc should be returned to release the held funds.
Source§

fn handle_release_held_htlc( &self, _message: ReleaseHeldHtlc, _context: AsyncPaymentsContext, )

Handle a ReleaseHeldHtlc message. If authentication of the message succeeds, an HTLC should be released to the corresponding payee.
Source§

fn release_pending_messages( &self, ) -> Vec<(AsyncPaymentsMessage, MessageSendInstructions)>

Release any AsyncPaymentsMessages that need to be sent. Read more
Source§

impl CustomMessageHandler for IgnoringMessageHandler

Source§

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

fn get_and_clear_pending_msg(&self) -> Vec<(PublicKey, Self::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.
Source§

fn peer_disconnected(&self, _their_node_id: PublicKey)

Indicates a peer disconnected.
Source§

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

Handle a peer connecting. Read more
Source§

fn provided_node_features(&self) -> NodeFeatures

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

fn provided_init_features(&self, _their_node_id: PublicKey) -> InitFeatures

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

impl CustomMessageReader for IgnoringMessageHandler

Source§

type CustomMessage = Infallible

The type of the message decoded by the implementation.
Source§

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

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

impl CustomOnionMessageHandler for IgnoringMessageHandler

Source§

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

fn handle_custom_message( &self, _message: Infallible, _context: Option<Vec<u8>>, _responder: Option<Responder>, ) -> Option<(Infallible, ResponseInstruction)>

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

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

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

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

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

impl DNSResolverMessageHandler for IgnoringMessageHandler

Source§

fn handle_dnssec_query( &self, _message: DNSSECQuery, _responder: Option<Responder>, ) -> Option<(DNSResolverMessage, ResponseInstruction)>

Handle a DNSSECQuery message. Read more
Source§

fn handle_dnssec_proof( &self, _message: DNSSECProof, _context: DNSResolverContext, )

Handle a DNSSECProof message (in response to a DNSSECQuery we presumably sent). Read more
Source§

fn provided_node_features(&self) -> NodeFeatures

Gets the node feature flags which this handler itself supports. Useful for setting the dns_resolver flag if this handler supports returning DNSSECProof messages in response to DNSSECQuery messages.
Source§

fn release_pending_messages( &self, ) -> Vec<(DNSResolverMessage, MessageSendInstructions)>

Release any DNSResolverMessages that need to be sent.
Source§

impl Deref for IgnoringMessageHandler

Source§

type Target = IgnoringMessageHandler

The resulting type after dereferencing.
Source§

fn deref(&self) -> &Self

Dereferences the value.
Source§

impl MessageSendEventsProvider for IgnoringMessageHandler

Source§

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

impl OffersMessageHandler for IgnoringMessageHandler

Source§

fn handle_message( &self, _message: OffersMessage, _context: Option<OffersContext>, _responder: Option<Responder>, ) -> Option<(OffersMessage, ResponseInstruction)>

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

fn release_pending_messages( &self, ) -> Vec<(OffersMessage, MessageSendInstructions)>

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

impl OnionMessageHandler for IgnoringMessageHandler

Source§

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

Handle an incoming onion_message message from the given peer.
Source§

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

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

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

fn timer_tick_occurred(&self)

Performs actions that should happen roughly every ten seconds after startup. Allows handlers to drop any buffered onion messages intended for prospective peers.
Source§

fn provided_node_features(&self) -> NodeFeatures

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

fn provided_init_features(&self, _their_node_id: PublicKey) -> InitFeatures

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

impl RoutingMessageHandler for IgnoringMessageHandler

Source§

fn handle_node_announcement( &self, _their_node_id: Option<PublicKey>, _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. Read more
Source§

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

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

fn handle_channel_update( &self, _their_node_id: Option<PublicKey>, _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. Read more
Source§

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

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

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

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

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

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

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

fn provided_node_features(&self) -> NodeFeatures

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

fn provided_init_features(&self, _their_node_id: PublicKey) -> InitFeatures

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

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

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<P, T> Receiver for P
where P: Deref<Target = T> + ?Sized, T: ?Sized,

Source§

type Target = T

🔬This is a nightly-only experimental API. (arbitrary_self_types)
The target type on which the method may be called.
Source§

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

Source§

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

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

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

Source§

fn vzip(self) -> V