Skip to content

Commit 7e22541

Browse files
committed
f - update short_to_chan_info
1 parent 1386bec commit 7e22541

File tree

1 file changed

+13
-1
lines changed

1 file changed

+13
-1
lines changed

lightning/src/ln/channelmanager.rs

+13-1
Original file line numberDiff line numberDiff line change
@@ -3147,13 +3147,20 @@ macro_rules! send_channel_ready {
31473147
let outbound_alias_insert = short_to_chan_info.insert($channel.context.outbound_scid_alias(), ($channel.context.get_counterparty_node_id(), $channel.context.channel_id()));
31483148
assert!(outbound_alias_insert.is_none() || outbound_alias_insert.unwrap() == ($channel.context.get_counterparty_node_id(), $channel.context.channel_id()),
31493149
"SCIDs should never collide - ensure you weren't behind the chain tip by a full month when creating channels");
3150+
insert_short_channel_id!(short_to_chan_info, $channel);
3151+
}}
3152+
}
3153+
3154+
macro_rules! insert_short_channel_id {
3155+
($short_to_chan_info: ident, $channel: expr) => {{
31503156
if let Some(real_scid) = $channel.funding.get_short_channel_id() {
3151-
let scid_insert = short_to_chan_info.insert(real_scid, ($channel.context.get_counterparty_node_id(), $channel.context.channel_id()));
3157+
let scid_insert = $short_to_chan_info.insert(real_scid, ($channel.context.get_counterparty_node_id(), $channel.context.channel_id()));
31523158
assert!(scid_insert.is_none() || scid_insert.unwrap() == ($channel.context.get_counterparty_node_id(), $channel.context.channel_id()),
31533159
"SCIDs should never collide - ensure you weren't behind the chain tip by a full month when creating channels");
31543160
}
31553161
}}
31563162
}
3163+
31573164
macro_rules! emit_funding_tx_broadcast_safe_event {
31583165
($locked_events: expr, $channel: expr, $funding_txo: expr) => {
31593166
if !$channel.context.funding_tx_broadcast_safe_event_emitted() {
@@ -11729,6 +11736,11 @@ where
1172911736
},
1173011737
#[cfg(splicing)]
1173111738
Some(FundingConfirmedMessage::Splice(splice_locked)) => {
11739+
if announcement_sigs.is_some() {
11740+
let mut short_to_chan_info = self.short_to_chan_info.write().unwrap();
11741+
insert_short_channel_id!(short_to_chan_info, funded_channel);
11742+
}
11743+
1173211744
pending_msg_events.push(MessageSendEvent::SendSpliceLocked {
1173311745
node_id: funded_channel.context.get_counterparty_node_id(),
1173411746
msg: splice_locked,

0 commit comments

Comments
 (0)