Skip to content

Commit dbe2f63

Browse files
committed
Move the channel_announcement process log into NetworkGraph
This ensures its always written after we update the graph, no matter how we updated the graph.
1 parent 19f28c0 commit dbe2f63

File tree

1 file changed

+4
-2
lines changed

1 file changed

+4
-2
lines changed

lightning/src/routing/gossip.rs

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -382,7 +382,6 @@ where C::Target: ChainAccess, L::Target: Logger
382382

383383
fn handle_channel_announcement(&self, msg: &msgs::ChannelAnnouncement) -> Result<bool, LightningError> {
384384
self.network_graph.update_channel_from_announcement(msg, &self.chain_access)?;
385-
log_gossip!(self.logger, "Added channel_announcement for {}{}", msg.contents.short_channel_id, if !msg.contents.excess_data.is_empty() { " with excess uninterpreted data!" } else { "" });
386385
Ok(msg.contents.excess_data.len() <= MAX_EXCESS_BYTES_FOR_RELAY)
387386
}
388387

@@ -1560,7 +1559,10 @@ impl<L: Deref> NetworkGraph<L> where L::Target: Logger {
15601559
announcement_received_time,
15611560
};
15621561

1563-
self.add_channel_between_nodes(msg.short_channel_id, chan_info, utxo_value)
1562+
self.add_channel_between_nodes(msg.short_channel_id, chan_info, utxo_value)?;
1563+
1564+
log_gossip!(self.logger, "Added channel_announcement for {}{}", msg.short_channel_id, if !msg.excess_data.is_empty() { " with excess uninterpreted data!" } else { "" });
1565+
Ok(())
15641566
}
15651567

15661568
/// Marks a channel in the graph as failed if a corresponding HTLC fail was sent.

0 commit comments

Comments
 (0)