You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Consistently clean up when failing in internal_funding_created
When we fail to accept a counterparty's funding for various
reasons, we should ensure we call the correct cleanup methods in
`internal_funding_created` to remove the temporary data for the
channel in our various internal structs (primarily the SCID alias
map).
This adds the missing cleanup, using `convert_chan_phase_err`
consistently in all the error paths.
This also ensures we get a `ChannelClosed` event when relevant.
return Err(MsgHandleErrInternal::send_err_msg_no_close(format!("Got an unexpected funding_created message from peer with counterparty_node_id {}", counterparty_node_id), msg.temporary_channel_id));
6229
+
Some(mut phase) => {
6230
+
let err_msg = format!("Got an unexpected funding_created message from peer with counterparty_node_id {}", counterparty_node_id);
None => return Err(MsgHandleErrInternal::send_err_msg_no_close(format!("Got a message for a channel from the wrong node! No such channel for the passed counterparty_node_id {}", counterparty_node_id), msg.temporary_channel_id))
6230
6235
};
6231
6236
6232
-
match peer_state.channel_by_id.entry(chan.context.channel_id()) {
6237
+
let funded_channel_id = chan.context.channel_id();
6238
+
6239
+
macro_rules! fail_chan { ($err: expr) => { {
6240
+
// Note that at this point we've filled in the funding outpoint on our
6241
+
// channel, but its actually in conflict with another channel. Thus, if
6242
+
// we call `convert_chan_phase_err` immediately (thus calling
6243
+
// `update_maps_on_chan_removal`), we'll remove the existing channel
6244
+
// from `outpoint_to_peer`. Thus, we must first unset the funding outpoint
0 commit comments