@@ -10505,10 +10505,22 @@ This indicates a bug inside LDK. Please report this error at https://github.com/
10505
10505
match peer_state.channel_by_id.entry(msg.channel_id) {
10506
10506
hash_map::Entry::Occupied(mut chan_entry) => {
10507
10507
let res = chan_entry.get_mut().tx_abort(msg, &self.logger);
10508
- let tx_abort_and_splice_failed = try_channel_entry!(self, peer_state, res, chan_entry);
10508
+ let (tx_abort, splice_failed) = try_channel_entry!(self, peer_state, res, chan_entry);
10509
10509
10510
- // Emit SpliceFailed event and send TxAbort response if we had an active splice negotiation
10511
- if let Some((tx_abort_msg, splice_funding_failed)) = tx_abort_and_splice_failed {
10510
+ let persist = if tx_abort.is_some() || splice_failed.is_some() {
10511
+ NotifyOption::DoPersist
10512
+ } else {
10513
+ NotifyOption::SkipPersistNoEvents
10514
+ };
10515
+
10516
+ if let Some(tx_abort_msg) = tx_abort {
10517
+ peer_state.pending_msg_events.push(MessageSendEvent::SendTxAbort {
10518
+ node_id: *counterparty_node_id,
10519
+ msg: tx_abort_msg,
10520
+ });
10521
+ }
10522
+
10523
+ if let Some(splice_funding_failed) = splice_failed {
10512
10524
let pending_events = &mut self.pending_events.lock().unwrap();
10513
10525
pending_events.push_back((events::Event::SpliceFailed {
10514
10526
channel_id: msg.channel_id,
@@ -10519,15 +10531,9 @@ This indicates a bug inside LDK. Please report this error at https://github.com/
10519
10531
contributed_inputs: splice_funding_failed.contributed_inputs,
10520
10532
contributed_outputs: splice_funding_failed.contributed_outputs,
10521
10533
}, None));
10522
-
10523
- peer_state.pending_msg_events.push(MessageSendEvent::SendTxAbort {
10524
- node_id: *counterparty_node_id,
10525
- msg: tx_abort_msg,
10526
- });
10527
- Ok(NotifyOption::DoPersist)
10528
- } else {
10529
- Ok(NotifyOption::SkipPersistNoEvents)
10530
10534
}
10535
+
10536
+ Ok(persist)
10531
10537
},
10532
10538
hash_map::Entry::Vacant(_) => {
10533
10539
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.channel_id))
0 commit comments