Skip to content

Commit 4223d2e

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 f79f750 commit 4223d2e

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
@@ -381,7 +381,6 @@ where U::Target: UtxoLookup, L::Target: Logger
381381

382382
fn handle_channel_announcement(&self, msg: &msgs::ChannelAnnouncement) -> Result<bool, LightningError> {
383383
self.network_graph.update_channel_from_announcement(msg, &self.utxo_lookup)?;
384-
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 { "" });
385384
Ok(msg.contents.excess_data.len() <= MAX_EXCESS_BYTES_FOR_RELAY)
386385
}
387386

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

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

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

0 commit comments

Comments
 (0)