Skip to content

Commit a0596ff

Browse files
committed
fix Use try_channel_entry macro in some error branches
1 parent c1e5c3f commit a0596ff

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
@@ -9350,7 +9350,7 @@ This indicates a bug inside LDK. Please report this error at https://github.com/
93509350
});
93519351
},
93529352
Err(err) => {
9353-
return Err(MsgHandleErrInternal::from_chan_no_close(err, msg.channel_id));
9353+
try_channel_entry!(self, peer_state, Err(err), chan_entry)
93549354
}
93559355
}
93569356
} else {
@@ -9385,12 +9385,12 @@ This indicates a bug inside LDK. Please report this error at https://github.com/
93859385
"Got a message for a channel from the wrong node! No such channel for the passed counterparty_node_id {}",
93869386
counterparty_node_id
93879387
), msg.channel_id)),
9388-
hash_map::Entry::Occupied(mut chan) => {
9389-
if let Some(chan) = chan.get_mut().as_funded_mut() {
9388+
hash_map::Entry::Occupied(mut chan_entry) => {
9389+
if let Some(chan) = chan_entry.get_mut().as_funded_mut() {
93909390
match chan.splice_ack(msg) {
93919391
Ok(_) => {}
93929392
Err(err) => {
9393-
return Err(MsgHandleErrInternal::from_chan_no_close(err, msg.channel_id));
9393+
try_channel_entry!(self, peer_state, Err(err), chan_entry)
93949394
}
93959395
}
93969396
} 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)