Skip to content

Commit 1806c3a

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 ed13eb6 commit 1806c3a

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
@@ -361,7 +361,6 @@ where C::Target: ChainAccess, L::Target: Logger
361361

362362
fn handle_channel_announcement(&self, msg: &msgs::ChannelAnnouncement) -> Result<bool, LightningError> {
363363
self.network_graph.update_channel_from_announcement(msg, &self.chain_access)?;
364-
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 { "" });
365364
Ok(msg.contents.excess_data.len() <= MAX_EXCESS_BYTES_FOR_RELAY)
366365
}
367366

@@ -1542,7 +1541,10 @@ impl<L: Deref> NetworkGraph<L> where L::Target: Logger {
15421541
announcement_received_time,
15431542
};
15441543

1545-
self.add_channel_between_nodes(msg.short_channel_id, chan_info, utxo_value)
1544+
self.add_channel_between_nodes(msg.short_channel_id, chan_info, utxo_value)?;
1545+
1546+
log_gossip!(self.logger, "Added channel_announcement for {}{}", msg.short_channel_id, if !msg.excess_data.is_empty() { " with excess uninterpreted data!" } else { "" });
1547+
Ok(())
15461548
}
15471549

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

0 commit comments

Comments
 (0)