@@ -11252,7 +11252,7 @@ This indicates a bug inside LDK. Please report this error at https://github.com/
1125211252 >(
1125311253 &self, counterparty_node_id: &PublicKey, channel_id: ChannelId,
1125411254 tx_msg_handler: HandleTxMsgFn,
11255- ) -> Result<NotifyOption , MsgHandleErrInternal> {
11255+ ) -> Result<() , MsgHandleErrInternal> {
1125611256 let per_peer_state = self.per_peer_state.read().unwrap();
1125711257 let peer_state_mutex = per_peer_state.get(counterparty_node_id).ok_or_else(|| {
1125811258 debug_assert!(false);
@@ -11267,7 +11267,7 @@ This indicates a bug inside LDK. Please report this error at https://github.com/
1126711267 Ok(msg_send) => {
1126811268 let msg_send_event = msg_send.into_msg_send_event(*counterparty_node_id);
1126911269 peer_state.pending_msg_events.push(msg_send_event);
11270- Ok(NotifyOption::SkipPersistHandleEvents )
11270+ Ok(() )
1127111271 },
1127211272 Err(InteractiveTxMsgError {
1127311273 err,
@@ -11305,31 +11305,31 @@ This indicates a bug inside LDK. Please report this error at https://github.com/
1130511305
1130611306 fn internal_tx_add_input(
1130711307 &self, counterparty_node_id: PublicKey, msg: &msgs::TxAddInput,
11308- ) -> Result<NotifyOption , MsgHandleErrInternal> {
11308+ ) -> Result<() , MsgHandleErrInternal> {
1130911309 self.internal_tx_msg(&counterparty_node_id, msg.channel_id, |channel: &mut Channel<SP>| {
1131011310 channel.tx_add_input(msg, &self.logger)
1131111311 })
1131211312 }
1131311313
1131411314 fn internal_tx_add_output(
1131511315 &self, counterparty_node_id: PublicKey, msg: &msgs::TxAddOutput,
11316- ) -> Result<NotifyOption , MsgHandleErrInternal> {
11316+ ) -> Result<() , MsgHandleErrInternal> {
1131711317 self.internal_tx_msg(&counterparty_node_id, msg.channel_id, |channel: &mut Channel<SP>| {
1131811318 channel.tx_add_output(msg, &self.logger)
1131911319 })
1132011320 }
1132111321
1132211322 fn internal_tx_remove_input(
1132311323 &self, counterparty_node_id: PublicKey, msg: &msgs::TxRemoveInput,
11324- ) -> Result<NotifyOption , MsgHandleErrInternal> {
11324+ ) -> Result<() , MsgHandleErrInternal> {
1132511325 self.internal_tx_msg(&counterparty_node_id, msg.channel_id, |channel: &mut Channel<SP>| {
1132611326 channel.tx_remove_input(msg, &self.logger)
1132711327 })
1132811328 }
1132911329
1133011330 fn internal_tx_remove_output(
1133111331 &self, counterparty_node_id: PublicKey, msg: &msgs::TxRemoveOutput,
11332- ) -> Result<NotifyOption , MsgHandleErrInternal> {
11332+ ) -> Result<() , MsgHandleErrInternal> {
1133311333 self.internal_tx_msg(&counterparty_node_id, msg.channel_id, |channel: &mut Channel<SP>| {
1133411334 channel.tx_remove_output(msg, &self.logger)
1133511335 })
@@ -16020,56 +16020,47 @@ impl<
1602016020 fn handle_tx_add_input(&self, counterparty_node_id: PublicKey, msg: &msgs::TxAddInput) {
1602116021 let _persistence_guard = PersistenceNotifierGuard::optionally_notify(self, || {
1602216022 let res = self.internal_tx_add_input(counterparty_node_id, msg);
16023- let persist = match &res {
16024- Err(_) => NotifyOption::DoPersist,
16025- Ok(persist) => *persist,
16026- };
16023+ debug_assert!(res.as_ref().err().map_or(true, |err| !err.closes_channel()));
1602716024 let _ = self.handle_error(res, counterparty_node_id);
16028- persist
16025+ NotifyOption::SkipPersistHandleEvents
1602916026 });
1603016027 }
1603116028
1603216029 fn handle_tx_add_output(&self, counterparty_node_id: PublicKey, msg: &msgs::TxAddOutput) {
1603316030 let _persistence_guard = PersistenceNotifierGuard::optionally_notify(self, || {
1603416031 let res = self.internal_tx_add_output(counterparty_node_id, msg);
16035- let persist = match &res {
16036- Err(_) => NotifyOption::DoPersist,
16037- Ok(persist) => *persist,
16038- };
16032+ debug_assert!(res.as_ref().err().map_or(true, |err| !err.closes_channel()));
1603916033 let _ = self.handle_error(res, counterparty_node_id);
16040- persist
16034+ NotifyOption::SkipPersistHandleEvents
1604116035 });
1604216036 }
1604316037
1604416038 fn handle_tx_remove_input(&self, counterparty_node_id: PublicKey, msg: &msgs::TxRemoveInput) {
1604516039 let _persistence_guard = PersistenceNotifierGuard::optionally_notify(self, || {
1604616040 let res = self.internal_tx_remove_input(counterparty_node_id, msg);
16047- let persist = match &res {
16048- Err(_) => NotifyOption::DoPersist,
16049- Ok(persist) => *persist,
16050- };
16041+ debug_assert!(res.as_ref().err().map_or(true, |err| !err.closes_channel()));
1605116042 let _ = self.handle_error(res, counterparty_node_id);
16052- persist
16043+ NotifyOption::SkipPersistHandleEvents
1605316044 });
1605416045 }
1605516046
1605616047 fn handle_tx_remove_output(&self, counterparty_node_id: PublicKey, msg: &msgs::TxRemoveOutput) {
1605716048 let _persistence_guard = PersistenceNotifierGuard::optionally_notify(self, || {
1605816049 let res = self.internal_tx_remove_output(counterparty_node_id, msg);
16059- let persist = match &res {
16060- Err(_) => NotifyOption::DoPersist,
16061- Ok(persist) => *persist,
16062- };
16050+ debug_assert!(res.as_ref().err().map_or(true, |err| !err.closes_channel()));
1606316051 let _ = self.handle_error(res, counterparty_node_id);
16064- persist
16052+ NotifyOption::SkipPersistHandleEvents
1606516053 });
1606616054 }
1606716055
1606816056 fn handle_tx_complete(&self, counterparty_node_id: PublicKey, msg: &msgs::TxComplete) {
1606916057 let _persistence_guard = PersistenceNotifierGuard::optionally_notify(self, || {
1607016058 let res = self.internal_tx_complete(counterparty_node_id, msg);
1607116059 let persist = match &res {
16072- Err(_) => NotifyOption::DoPersist,
16060+ Err(err) => {
16061+ debug_assert!(!err.closes_channel());
16062+ NotifyOption::SkipPersistHandleEvents
16063+ },
1607316064 Ok(persist) => *persist,
1607416065 };
1607516066 let _ = self.handle_error(res, counterparty_node_id);
0 commit comments