Skip to content

Commit 24c97f2

Browse files
committed
Improve network graph update logging.
1 parent a24626b commit 24c97f2

File tree

1 file changed

+5
-0
lines changed

1 file changed

+5
-0
lines changed

lightning/src/routing/gossip.rs

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1553,6 +1553,8 @@ impl<L: Deref> NetworkGraph<L> where L::Target: Logger {
15531553
let node_id_a = channel_info.node_one.clone();
15541554
let node_id_b = channel_info.node_two.clone();
15551555

1556+
log_gossip!(self.logger, "Adding channel {} between nodes {} and {}", short_channel_id, node_id_a, node_id_b);
1557+
15561558
match channels.entry(short_channel_id) {
15571559
IndexedMapEntry::Occupied(mut entry) => {
15581560
//TODO: because asking the blockchain if short_channel_id is valid is only optional
@@ -1805,6 +1807,7 @@ impl<L: Deref> NetworkGraph<L> where L::Target: Logger {
18051807
if !scids_to_remove.is_empty() {
18061808
let mut nodes = self.nodes.write().unwrap();
18071809
for scid in scids_to_remove {
1810+
log_gossip!(self.logger, "Removing channel {}", scid);
18081811
let info = channels.remove(&scid).expect("We just accessed this scid, it should be present");
18091812
Self::remove_channel_in_nodes(&mut nodes, &info, scid);
18101813
self.removed_channels.lock().unwrap().insert(scid, Some(current_time_unix));
@@ -1878,6 +1881,8 @@ impl<L: Deref> NetworkGraph<L> where L::Target: Logger {
18781881
}
18791882
}
18801883

1884+
log_gossip!(self.logger, "Updating channel {} in direction {}", msg.short_channel_id, msg.flags & 1);
1885+
18811886
let mut channels = self.channels.write().unwrap();
18821887
match channels.get_mut(&msg.short_channel_id) {
18831888
None => {

0 commit comments

Comments
 (0)