@@ -11116,14 +11116,30 @@ where
11116
11116
11117
11117
#[cfg(splicing)]
11118
11118
fn handle_splice_init(&self, counterparty_node_id: PublicKey, msg: &msgs::SpliceInit) {
11119
- let _persistence_guard = PersistenceNotifierGuard::notify_on_drop(self);
11120
- let _ = handle_error!(self, self.internal_splice_init(&counterparty_node_id, msg), counterparty_node_id);
11119
+ let _persistence_guard = PersistenceNotifierGuard::optionally_notify(self, || {
11120
+ let res = self.internal_splice_init(&counterparty_node_id, msg);
11121
+ let persist = match &res {
11122
+ Err(e) if e.closes_channel() => NotifyOption::DoPersist,
11123
+ Err(_) => NotifyOption::SkipPersistHandleEvents,
11124
+ Ok(()) => NotifyOption::SkipPersistNoEvents,
11125
+ };
11126
+ let _ = handle_error!(self, res, counterparty_node_id);
11127
+ persist
11128
+ });
11121
11129
}
11122
11130
11123
11131
#[cfg(splicing)]
11124
11132
fn handle_splice_ack(&self, counterparty_node_id: PublicKey, msg: &msgs::SpliceAck) {
11125
- let _persistence_guard = PersistenceNotifierGuard::notify_on_drop(self);
11126
- let _ = handle_error!(self, self.internal_splice_ack(&counterparty_node_id, msg), counterparty_node_id);
11133
+ let _persistence_guard = PersistenceNotifierGuard::optionally_notify(self, || {
11134
+ let res = self.internal_splice_ack(&counterparty_node_id, msg);
11135
+ let persist = match &res {
11136
+ Err(e) if e.closes_channel() => NotifyOption::DoPersist,
11137
+ Err(_) => NotifyOption::SkipPersistHandleEvents,
11138
+ Ok(()) => NotifyOption::SkipPersistNoEvents,
11139
+ };
11140
+ let _ = handle_error!(self, res, counterparty_node_id);
11141
+ persist
11142
+ });
11127
11143
}
11128
11144
11129
11145
#[cfg(splicing)]
0 commit comments