Skip to content

Commit 26709b8

Browse files
committed
fix Use try_channel_entry macro in some error branches
1 parent 5784213 commit 26709b8

File tree

2 files changed

+10
-5
lines changed

2 files changed

+10
-5
lines changed

lightning/src/ln/channelmanager.rs

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -9571,7 +9571,7 @@ This indicates a bug inside LDK. Please report this error at https://github.com/
95719571
});
95729572
},
95739573
Err(err) => {
9574-
return Err(MsgHandleErrInternal::from_chan_no_close(err, msg.channel_id));
9574+
try_channel_entry!(self, peer_state, Err(err), chan_entry)
95759575
}
95769576
}
95779577
} else {
@@ -9606,12 +9606,12 @@ This indicates a bug inside LDK. Please report this error at https://github.com/
96069606
"Got a message for a channel from the wrong node! No such channel for the passed counterparty_node_id {}",
96079607
counterparty_node_id
96089608
), msg.channel_id)),
9609-
hash_map::Entry::Occupied(mut chan) => {
9610-
if let Some(chan) = chan.get_mut().as_funded_mut() {
9609+
hash_map::Entry::Occupied(mut chan_entry) => {
9610+
if let Some(chan) = chan_entry.get_mut().as_funded_mut() {
96119611
match chan.splice_ack(msg) {
96129612
Ok(_) => {}
96139613
Err(err) => {
9614-
return Err(MsgHandleErrInternal::from_chan_no_close(err, msg.channel_id));
9614+
try_channel_entry!(self, peer_state, Err(err), chan_entry)
96159615
}
96169616
}
96179617
} else {

lightning/src/ln/functional_tests_splice.rs

Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -32,7 +32,12 @@ fn test_v1_splice_in() {
3232
let channel_reserve_amnt_sat = 1_000;
3333

3434
let (_, _, channel_id, _) = create_announced_chan_between_nodes_with_value(
35-
&nodes, initiator_node_index, acceptor_node_index, channel_value_sat, push_msat);
35+
&nodes,
36+
initiator_node_index,
37+
acceptor_node_index,
38+
channel_value_sat,
39+
push_msat,
40+
);
3641

3742
let expected_funded_channel_id =
3843
"ae3367da2c13bc1ceb86bf56418f62828f7ce9d6bfb15a46af5ba1f1ed8b124f";

0 commit comments

Comments
 (0)