@@ -11528,14 +11528,30 @@ where
11528
11528
11529
11529
#[cfg(splicing)]
11530
11530
fn handle_splice_init(&self, counterparty_node_id: PublicKey, msg: &msgs::SpliceInit) {
11531
- let _persistence_guard = PersistenceNotifierGuard::notify_on_drop(self);
11532
- let _ = handle_error!(self, self.internal_splice_init(&counterparty_node_id, msg), counterparty_node_id);
11531
+ let _persistence_guard = PersistenceNotifierGuard::optionally_notify(self, || {
11532
+ let res = self.internal_splice_init(&counterparty_node_id, msg);
11533
+ let persist = match &res {
11534
+ Err(e) if e.closes_channel() => NotifyOption::DoPersist,
11535
+ Err(_) => NotifyOption::SkipPersistHandleEvents,
11536
+ Ok(()) => NotifyOption::SkipPersistNoEvents,
11537
+ };
11538
+ let _ = handle_error!(self, res, counterparty_node_id);
11539
+ persist
11540
+ });
11533
11541
}
11534
11542
11535
11543
#[cfg(splicing)]
11536
11544
fn handle_splice_ack(&self, counterparty_node_id: PublicKey, msg: &msgs::SpliceAck) {
11537
- let _persistence_guard = PersistenceNotifierGuard::notify_on_drop(self);
11538
- let _ = handle_error!(self, self.internal_splice_ack(&counterparty_node_id, msg), counterparty_node_id);
11545
+ let _persistence_guard = PersistenceNotifierGuard::optionally_notify(self, || {
11546
+ let res = self.internal_splice_ack(&counterparty_node_id, msg);
11547
+ let persist = match &res {
11548
+ Err(e) if e.closes_channel() => NotifyOption::DoPersist,
11549
+ Err(_) => NotifyOption::SkipPersistHandleEvents,
11550
+ Ok(()) => NotifyOption::SkipPersistNoEvents,
11551
+ };
11552
+ let _ = handle_error!(self, res, counterparty_node_id);
11553
+ persist
11554
+ });
11539
11555
}
11540
11556
11541
11557
#[cfg(splicing)]
0 commit comments