Skip to content

Commit b61ce53

Browse files
author
Antoine Riard
committed
Add short_channel_id in ChannelInfo
Next commit expose publicly structure to allow displaying network graph. Even if we already index by short_channel_id in NetworkMap, an exposed identifier makes exposition more useful.
1 parent a0f9b64 commit b61ce53

File tree

1 file changed

+4
-1
lines changed

1 file changed

+4
-1
lines changed

lightning/src/ln/router.rs

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -123,6 +123,7 @@ impl_writeable!(DirectionalChannelInfo, 0, {
123123

124124
#[derive(PartialEq)]
125125
struct ChannelInfo {
126+
short_channel_id: u64,
126127
features: ChannelFeatures,
127128
one_to_two: DirectionalChannelInfo,
128129
two_to_one: DirectionalChannelInfo,
@@ -133,12 +134,13 @@ struct ChannelInfo {
133134

134135
impl std::fmt::Display for ChannelInfo {
135136
fn fmt(&self, f: &mut std::fmt::Formatter) -> Result<(), std::fmt::Error> {
136-
write!(f, "features: {}, one_to_two: {}, two_to_one: {}", log_bytes!(self.features.encode()), self.one_to_two, self.two_to_one)?;
137+
write!(f, "short_channel_id: {}, features: {}, one_to_two: {}, two_to_one: {}", self.short_channel_id, log_bytes!(self.features.encode()), self.one_to_two, self.two_to_one)?;
137138
Ok(())
138139
}
139140
}
140141

141142
impl_writeable!(ChannelInfo, 0, {
143+
short_channel_id,
142144
features,
143145
one_to_two,
144146
two_to_one,
@@ -485,6 +487,7 @@ impl RoutingMessageHandler for Router {
485487
let should_relay = msg.contents.excess_data.is_empty();
486488

487489
let chan_info = ChannelInfo {
490+
short_channel_id: msg.contents.short_channel_id,
488491
features: msg.contents.features.clone(),
489492
one_to_two: DirectionalChannelInfo {
490493
src_node_id: msg.contents.node_id_1.clone(),

0 commit comments

Comments
 (0)