fn handle_htlc_fail_channel_update(&self, _update: &HTLCFailChannelUpdate) { }
fn get_next_channel_announcements(&self, _starting_point: u64, _batch_amount: u8) -> Vec<(ChannelAnnouncement, Option<ChannelUpdate>, Option<ChannelUpdate>)> { Vec::new() }
fn get_next_node_announcements(&self, _starting_point: Option<&PublicKey>, _batch_amount: u8) -> Vec<NodeAnnouncement> { Vec::new() }
- fn should_request_full_sync(&self, _node_id: &PublicKey) -> bool { false }
fn sync_routing_table(&self, _their_node_id: &PublicKey, _init_msg: &Init) { }
fn handle_reply_channel_range(&self, _their_node_id: &PublicKey, _msg: ReplyChannelRange) -> Result<(), LightningError> { Ok(()) }
fn handle_reply_short_channel_ids_end(&self, _their_node_id: &PublicKey, _msg: ReplyShortChannelIdsEnd) -> Result<(), LightningError> { Ok(()) }
/// 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 get_next_node_announcements(&self, starting_point: Option<&PublicKey>, batch_amount: u8) -> Vec<NodeAnnouncement>;
- /// Returns whether a full sync should be requested from a peer.
- fn should_request_full_sync(&self, node_id: &PublicKey) -> bool;
/// Initiates routing gossip sync by querying a peer to discover channels
/// and their associated routing gossip messages. This method will use a
/// sync strategy defined by the implementor.
pub fn read_locked_graph<'a>(&'a self) -> LockedNetworkGraph<'a> {
LockedNetworkGraph(self.network_graph.read().unwrap())
}
+
+ /// Returns true when a full routing table sync should be performed with a peer.
+ fn should_request_full_sync(&self, _node_id: &PublicKey) -> bool {
+ //TODO: Determine whether to request a full sync based on the network map.
+ const FULL_SYNCS_TO_REQUEST: usize = 5;
+ if self.full_syncs_requested.load(Ordering::Acquire) < FULL_SYNCS_TO_REQUEST {
+ self.full_syncs_requested.fetch_add(1, Ordering::AcqRel);
+ true
+ } else {
+ false
+ }
+ }
}
impl<'a> LockedNetworkGraph<'a> {
result
}
- fn should_request_full_sync(&self, _node_id: &PublicKey) -> bool {
- //TODO: Determine whether to request a full sync based on the network map.
- const FULL_SYNCS_TO_REQUEST: usize = 5;
- if self.full_syncs_requested.load(Ordering::Acquire) < FULL_SYNCS_TO_REQUEST {
- self.full_syncs_requested.fetch_add(1, Ordering::AcqRel);
- true
- } else {
- false
- }
- }
-
/// Initiates a stateless sync of routing gossip information with a peer
/// using gossip_queries. The default strategy used by this implementation
/// is to sync the full block range with several peers.
Vec::new()
}
- fn should_request_full_sync(&self, _node_id: &PublicKey) -> bool {
- self.request_full_sync.load(Ordering::Acquire)
- }
-
fn sync_routing_table(&self, _their_node_id: &PublicKey, _init_msg: &msgs::Init) {}
fn handle_reply_channel_range(&self, _their_node_id: &PublicKey, _msg: msgs::ReplyChannelRange) -> Result<(), msgs::LightningError> {