X-Git-Url: http://git.bitcoin.ninja/index.cgi?a=blobdiff_plain;f=lightning%2Fsrc%2Fln%2Fmsgs.rs;h=e8b40c71d89e7f1825335bbe4a0abb0ed817970d;hb=be4bb58573ab6f56f363496574d64fa83074364b;hp=942bd82e93338fc73412778f898149b1595ddd99;hpb=1fd95496d1038352535a74065d2b06559e2192fb;p=rust-lightning diff --git a/lightning/src/ln/msgs.rs b/lightning/src/ln/msgs.rs index 942bd82e..e8b40c71 100644 --- a/lightning/src/ln/msgs.rs +++ b/lightning/src/ln/msgs.rs @@ -665,7 +665,7 @@ pub struct UnsignedNodeAnnouncement { pub timestamp: u32, /// The `node_id` this announcement originated from (don't rebroadcast the `node_announcement` back /// to this node). - pub node_id: PublicKey, + pub node_id: NodeId, /// An RGB color for UI purposes pub rgb: [u8; 3], /// An alias, for UI purposes. @@ -1057,7 +1057,7 @@ pub trait RoutingMessageHandler : MessageSendEventsProvider { /// the node *after* the provided pubkey and including up to one announcement immediately /// higher (as defined by `::cmp`) than `starting_point`. /// If `None` is provided for `starting_point`, we start at the first node. - fn get_next_node_announcement(&self, starting_point: Option<&PublicKey>) -> Option; + fn get_next_node_announcement(&self, starting_point: Option<&NodeId>) -> Option; /// 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. @@ -1082,6 +1082,13 @@ pub trait RoutingMessageHandler : MessageSendEventsProvider { /// list of `short_channel_id`s. fn handle_query_short_channel_ids(&self, their_node_id: &PublicKey, msg: QueryShortChannelIds) -> Result<(), LightningError>; + // Handler queueing status: + /// 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 + /// [`ChannelAnnouncement`]s. + fn processing_queue_high(&self) -> bool; + // Handler information: /// 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`] @@ -1845,7 +1852,7 @@ impl Readable for UnsignedNodeAnnouncement { fn read(r: &mut R) -> Result { let features: NodeFeatures = Readable::read(r)?; let timestamp: u32 = Readable::read(r)?; - let node_id: PublicKey = Readable::read(r)?; + let node_id: NodeId = Readable::read(r)?; let mut rgb = [0; 3]; r.read_exact(&mut rgb)?; let alias: [u8; 32] = Readable::read(r)?; @@ -2248,7 +2255,7 @@ mod tests { let unsigned_node_announcement = msgs::UnsignedNodeAnnouncement { features, timestamp: 20190119, - node_id: pubkey_1, + node_id: NodeId::from_pubkey(&pubkey_1), rgb: [32; 3], alias: [16;32], addresses,