@@ -11227,7 +11227,7 @@ This indicates a bug inside LDK. Please report this error at https://github.com/
1122711227 >(
1122811228 &self, counterparty_node_id: &PublicKey, channel_id: ChannelId,
1122911229 tx_msg_handler: HandleTxMsgFn,
11230- ) -> Result<NotifyOption , MsgHandleErrInternal> {
11230+ ) -> Result<() , MsgHandleErrInternal> {
1123111231 let per_peer_state = self.per_peer_state.read().unwrap();
1123211232 let peer_state_mutex = per_peer_state.get(counterparty_node_id).ok_or_else(|| {
1123311233 debug_assert!(false);
@@ -11242,7 +11242,7 @@ This indicates a bug inside LDK. Please report this error at https://github.com/
1124211242 Ok(msg_send) => {
1124311243 let msg_send_event = msg_send.into_msg_send_event(*counterparty_node_id);
1124411244 peer_state.pending_msg_events.push(msg_send_event);
11245- Ok(NotifyOption::SkipPersistHandleEvents )
11245+ Ok(() )
1124611246 },
1124711247 Err(InteractiveTxMsgError {
1124811248 err,
@@ -11280,31 +11280,31 @@ This indicates a bug inside LDK. Please report this error at https://github.com/
1128011280
1128111281 fn internal_tx_add_input(
1128211282 &self, counterparty_node_id: PublicKey, msg: &msgs::TxAddInput,
11283- ) -> Result<NotifyOption , MsgHandleErrInternal> {
11283+ ) -> Result<() , MsgHandleErrInternal> {
1128411284 self.internal_tx_msg(&counterparty_node_id, msg.channel_id, |channel: &mut Channel<SP>| {
1128511285 channel.tx_add_input(msg, &self.logger)
1128611286 })
1128711287 }
1128811288
1128911289 fn internal_tx_add_output(
1129011290 &self, counterparty_node_id: PublicKey, msg: &msgs::TxAddOutput,
11291- ) -> Result<NotifyOption , MsgHandleErrInternal> {
11291+ ) -> Result<() , MsgHandleErrInternal> {
1129211292 self.internal_tx_msg(&counterparty_node_id, msg.channel_id, |channel: &mut Channel<SP>| {
1129311293 channel.tx_add_output(msg, &self.logger)
1129411294 })
1129511295 }
1129611296
1129711297 fn internal_tx_remove_input(
1129811298 &self, counterparty_node_id: PublicKey, msg: &msgs::TxRemoveInput,
11299- ) -> Result<NotifyOption , MsgHandleErrInternal> {
11299+ ) -> Result<() , MsgHandleErrInternal> {
1130011300 self.internal_tx_msg(&counterparty_node_id, msg.channel_id, |channel: &mut Channel<SP>| {
1130111301 channel.tx_remove_input(msg, &self.logger)
1130211302 })
1130311303 }
1130411304
1130511305 fn internal_tx_remove_output(
1130611306 &self, counterparty_node_id: PublicKey, msg: &msgs::TxRemoveOutput,
11307- ) -> Result<NotifyOption , MsgHandleErrInternal> {
11307+ ) -> Result<() , MsgHandleErrInternal> {
1130811308 self.internal_tx_msg(&counterparty_node_id, msg.channel_id, |channel: &mut Channel<SP>| {
1130911309 channel.tx_remove_output(msg, &self.logger)
1131011310 })
@@ -15995,56 +15995,47 @@ impl<
1599515995 fn handle_tx_add_input(&self, counterparty_node_id: PublicKey, msg: &msgs::TxAddInput) {
1599615996 let _persistence_guard = PersistenceNotifierGuard::optionally_notify(self, || {
1599715997 let res = self.internal_tx_add_input(counterparty_node_id, msg);
15998- let persist = match &res {
15999- Err(_) => NotifyOption::DoPersist,
16000- Ok(persist) => *persist,
16001- };
15998+ debug_assert!(res.as_ref().err().map_or(true, |err| !err.closes_channel()));
1600215999 let _ = self.handle_error(res, counterparty_node_id);
16003- persist
16000+ NotifyOption::SkipPersistHandleEvents
1600416001 });
1600516002 }
1600616003
1600716004 fn handle_tx_add_output(&self, counterparty_node_id: PublicKey, msg: &msgs::TxAddOutput) {
1600816005 let _persistence_guard = PersistenceNotifierGuard::optionally_notify(self, || {
1600916006 let res = self.internal_tx_add_output(counterparty_node_id, msg);
16010- let persist = match &res {
16011- Err(_) => NotifyOption::DoPersist,
16012- Ok(persist) => *persist,
16013- };
16007+ debug_assert!(res.as_ref().err().map_or(true, |err| !err.closes_channel()));
1601416008 let _ = self.handle_error(res, counterparty_node_id);
16015- persist
16009+ NotifyOption::SkipPersistHandleEvents
1601616010 });
1601716011 }
1601816012
1601916013 fn handle_tx_remove_input(&self, counterparty_node_id: PublicKey, msg: &msgs::TxRemoveInput) {
1602016014 let _persistence_guard = PersistenceNotifierGuard::optionally_notify(self, || {
1602116015 let res = self.internal_tx_remove_input(counterparty_node_id, msg);
16022- let persist = match &res {
16023- Err(_) => NotifyOption::DoPersist,
16024- Ok(persist) => *persist,
16025- };
16016+ debug_assert!(res.as_ref().err().map_or(true, |err| !err.closes_channel()));
1602616017 let _ = self.handle_error(res, counterparty_node_id);
16027- persist
16018+ NotifyOption::SkipPersistHandleEvents
1602816019 });
1602916020 }
1603016021
1603116022 fn handle_tx_remove_output(&self, counterparty_node_id: PublicKey, msg: &msgs::TxRemoveOutput) {
1603216023 let _persistence_guard = PersistenceNotifierGuard::optionally_notify(self, || {
1603316024 let res = self.internal_tx_remove_output(counterparty_node_id, msg);
16034- let persist = match &res {
16035- Err(_) => NotifyOption::DoPersist,
16036- Ok(persist) => *persist,
16037- };
16025+ debug_assert!(res.as_ref().err().map_or(true, |err| !err.closes_channel()));
1603816026 let _ = self.handle_error(res, counterparty_node_id);
16039- persist
16027+ NotifyOption::SkipPersistHandleEvents
1604016028 });
1604116029 }
1604216030
1604316031 fn handle_tx_complete(&self, counterparty_node_id: PublicKey, msg: &msgs::TxComplete) {
1604416032 let _persistence_guard = PersistenceNotifierGuard::optionally_notify(self, || {
1604516033 let res = self.internal_tx_complete(counterparty_node_id, msg);
1604616034 let persist = match &res {
16047- Err(_) => NotifyOption::DoPersist,
16035+ Err(err) => {
16036+ debug_assert!(!err.closes_channel());
16037+ NotifyOption::SkipPersistHandleEvents
16038+ },
1604816039 Ok(persist) => *persist,
1604916040 };
1605016041 let _ = self.handle_error(res, counterparty_node_id);
0 commit comments