Docs improvements
[rust-lightning] / lightning / src / routing / gossip.rs
index 2b4ece0ba6bd02d523acd234468f6277d0c73c8e..48fcd81578395a152c8e61ed0ed6bf4639ea9cd2 100644 (file)
@@ -234,7 +234,7 @@ impl<G: Deref<Target=NetworkGraph<L>>, U: Deref, L: Deref> P2PGossipSync<G, U, L
 where U::Target: UtxoLookup, L::Target: Logger
 {
        /// Creates a new tracker of the actual state of the network of channels and nodes,
-       /// assuming an existing Network Graph.
+       /// assuming an existing [`NetworkGraph`].
        /// UTXO lookup is used to make sure announced channels exist on-chain, channel data is
        /// correct, and the announcement is signed with channel owners' keys.
        pub fn new(network_graph: G, utxo_lookup: Option<U>, logger: L) -> Self {
@@ -432,14 +432,20 @@ where U::Target: UtxoLookup, L::Target: Logger
        }
 
        /// Initiates a stateless sync of routing gossip information with a peer
-       /// using gossip_queries. The default strategy used by this implementation
+       /// using [`gossip_queries`]. The default strategy used by this implementation
        /// is to sync the full block range with several peers.
        ///
-       /// We should expect one or more reply_channel_range messages in response
-       /// to our query_channel_range. Each reply will enqueue a query_scid message
+       /// We should expect one or more [`reply_channel_range`] messages in response
+       /// to our [`query_channel_range`]. Each reply will enqueue a [`query_scid`] message
        /// to request gossip messages for each channel. The sync is considered complete
-       /// when the final reply_scids_end message is received, though we are not
+       /// when the final [`reply_scids_end`] message is received, though we are not
        /// tracking this directly.
+       ///
+       /// [`gossip_queries`]: https://github.com/lightning/bolts/blob/master/07-routing-gossip.md#query-messages
+       /// [`reply_channel_range`]: msgs::ReplyChannelRange
+       /// [`query_channel_range`]: msgs::QueryChannelRange
+       /// [`query_scid`]: msgs::QueryShortChannelIds
+       /// [`reply_scids_end`]: msgs::ReplyShortChannelIdsEnd
        fn peer_connected(&self, their_node_id: &PublicKey, init_msg: &Init, _inbound: bool) -> Result<(), ()> {
                // We will only perform a sync with peers that support gossip_queries.
                if !init_msg.features.supports_gossip_queries() {
@@ -886,9 +892,9 @@ impl Readable for ChannelInfo {
                        (0, features, required),
                        (1, announcement_received_time, (default_value, 0)),
                        (2, node_one, required),
-                       (4, one_to_two_wrap, ignorable),
+                       (4, one_to_two_wrap, upgradable_option),
                        (6, node_two, required),
-                       (8, two_to_one_wrap, ignorable),
+                       (8, two_to_one_wrap, upgradable_option),
                        (10, capacity_sats, required),
                        (12, announcement_message, required),
                });
@@ -1020,7 +1026,7 @@ impl EffectiveCapacity {
 /// Fees for routing via a given channel or a node
 #[derive(Eq, PartialEq, Copy, Clone, Debug, Hash)]
 pub struct RoutingFees {
-       /// Flat routing fee in satoshis
+       /// Flat routing fee in millisatoshis.
        pub base_msat: u32,
        /// Liquidity-based routing fee in millionths of a routed amount.
        /// In other words, 10000 is 1%.
@@ -1164,7 +1170,7 @@ impl Readable for NodeInfo {
 
                read_tlv_fields!(reader, {
                        (0, _lowest_inbound_channel_fees, option),
-                       (2, announcement_info_wrap, ignorable),
+                       (2, announcement_info_wrap, upgradable_option),
                        (4, channels, vec_type),
                });