Skip to content

Commit 367593b

Browse files
committed
fix Close channel if splice msg is received while not funded
1 parent 2e7f49b commit 367593b

File tree

1 file changed

+4
-5
lines changed

1 file changed

+4
-5
lines changed

lightning/src/ln/channelmanager.rs

Lines changed: 4 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -9800,13 +9800,12 @@ This indicates a bug inside LDK. Please report this error at https://github.com/
98009800
node_id: *counterparty_node_id,
98019801
msg: splice_ack_msg,
98029802
});
9803+
Ok(())
98039804
} else {
9804-
return Err(MsgHandleErrInternal::send_err_msg_no_close(format!("Channel is not funded, cannot be spliced"), msg.channel_id));
9805+
try_channel_entry!(self, peer_state, Err(ChannelError::close("Channel is not funded, cannot be spliced".into())), chan_entry)
98059806
}
98069807
},
9807-
};
9808-
9809-
Ok(())
9808+
}
98109809
}
98119810

98129811
/// Handle incoming splice request ack, transition channel to splice-pending (unless some check fails).
@@ -9840,7 +9839,7 @@ This indicates a bug inside LDK. Please report this error at https://github.com/
98409839
}
98419840
Ok(())
98429841
} else {
9843-
return Err(MsgHandleErrInternal::send_err_msg_no_close(format!("Channel is not funded, cannot be spliced"), msg.channel_id));
9842+
try_channel_entry!(self, peer_state, Err(ChannelError::close("Channel is not funded, cannot be spliced".into())), chan_entry)
98449843
}
98459844
},
98469845
}

0 commit comments

Comments
 (0)