@@ -11152,14 +11152,30 @@ where
11152
11152
11153
11153
#[cfg(splicing)]
11154
11154
fn handle_splice_init(&self, counterparty_node_id: PublicKey, msg: &msgs::SpliceInit) {
11155
- let _persistence_guard = PersistenceNotifierGuard::notify_on_drop(self);
11156
- let _ = handle_error!(self, self.internal_splice_init(&counterparty_node_id, msg), counterparty_node_id);
11155
+ let _persistence_guard = PersistenceNotifierGuard::optionally_notify(self, || {
11156
+ let res = self.internal_splice_init(&counterparty_node_id, msg);
11157
+ let persist = match &res {
11158
+ Err(e) if e.closes_channel() => NotifyOption::DoPersist,
11159
+ Err(_) => NotifyOption::SkipPersistHandleEvents,
11160
+ Ok(()) => NotifyOption::SkipPersistNoEvents,
11161
+ };
11162
+ let _ = handle_error!(self, res, counterparty_node_id);
11163
+ persist
11164
+ });
11157
11165
}
11158
11166
11159
11167
#[cfg(splicing)]
11160
11168
fn handle_splice_ack(&self, counterparty_node_id: PublicKey, msg: &msgs::SpliceAck) {
11161
- let _persistence_guard = PersistenceNotifierGuard::notify_on_drop(self);
11162
- let _ = handle_error!(self, self.internal_splice_ack(&counterparty_node_id, msg), counterparty_node_id);
11169
+ let _persistence_guard = PersistenceNotifierGuard::optionally_notify(self, || {
11170
+ let res = self.internal_splice_ack(&counterparty_node_id, msg);
11171
+ let persist = match &res {
11172
+ Err(e) if e.closes_channel() => NotifyOption::DoPersist,
11173
+ Err(_) => NotifyOption::SkipPersistHandleEvents,
11174
+ Ok(()) => NotifyOption::SkipPersistNoEvents,
11175
+ };
11176
+ let _ = handle_error!(self, res, counterparty_node_id);
11177
+ persist
11178
+ });
11163
11179
}
11164
11180
11165
11181
#[cfg(splicing)]
0 commit comments