@@ -3066,7 +3066,7 @@ macro_rules! break_channel_entry {
30663066 }
30673067}
30683068
3069- macro_rules! try_chan_phase_entry {
3069+ macro_rules! try_channel_entry {
30703070 ($self: ident, $peer_state: expr, $res: expr, $entry: expr) => {
30713071 match $res {
30723072 Ok(res) => res,
@@ -8014,7 +8014,7 @@ This indicates a bug inside LDK. Please report this error at https://github.com/
80148014 hash_map::Entry::Occupied(mut phase) => {
80158015 match phase.get_mut().as_unfunded_outbound_v1_mut() {
80168016 Some(chan) => {
8017- try_chan_phase_entry !(self, peer_state, chan.accept_channel(msg, &self.default_configuration.channel_handshake_limits, &peer_state.latest_features), phase);
8017+ try_channel_entry !(self, peer_state, chan.accept_channel(msg, &self.default_configuration.channel_handshake_limits, &peer_state.latest_features), phase);
80188018 (chan.context.get_value_satoshis(), chan.context.get_funding_redeemscript().to_p2wsh(), chan.context.get_user_id())
80198019 },
80208020 None => {
@@ -8290,7 +8290,7 @@ This indicates a bug inside LDK. Please report this error at https://github.com/
82908290 let (msg_send_event_opt, signing_session_opt) = match channel_phase.as_unfunded_v2_mut() {
82918291 Some(channel) => channel.tx_complete(msg)
82928292 .into_msg_send_event_or_signing_session(counterparty_node_id),
8293- None => try_chan_phase_entry !(self, peer_state, Err(ChannelError::Close(
8293+ None => try_channel_entry !(self, peer_state, Err(ChannelError::Close(
82948294 (
82958295 "Got a tx_complete message with no interactive transaction construction expected or in-progress".into(),
82968296 ClosureReason::HolderForceClosed { broadcasted_latest_txn: Some(false) },
@@ -8361,7 +8361,7 @@ This indicates a bug inside LDK. Please report this error at https://github.com/
83618361 match channel_phase {
83628362 Some(chan) => {
83638363 let logger = WithChannelContext::from(&self.logger, &chan.context, None);
8364- let (tx_signatures_opt, funding_tx_opt) = try_chan_phase_entry !(self, peer_state, chan.tx_signatures(msg, &&logger), chan_phase_entry);
8364+ let (tx_signatures_opt, funding_tx_opt) = try_channel_entry !(self, peer_state, chan.tx_signatures(msg, &&logger), chan_phase_entry);
83658365 if let Some(tx_signatures) = tx_signatures_opt {
83668366 peer_state.pending_msg_events.push(events::MessageSendEvent::SendTxSignatures {
83678367 node_id: *counterparty_node_id,
@@ -8376,7 +8376,7 @@ This indicates a bug inside LDK. Please report this error at https://github.com/
83768376 }
83778377 }
83788378 },
8379- None => try_chan_phase_entry !(self, peer_state, Err(ChannelError::Close(
8379+ None => try_channel_entry !(self, peer_state, Err(ChannelError::Close(
83808380 (
83818381 "Got an unexpected tx_signatures message".into(),
83828382 ClosureReason::HolderForceClosed { broadcasted_latest_txn: Some(false) },
@@ -8412,13 +8412,13 @@ This indicates a bug inside LDK. Please report this error at https://github.com/
84128412 // for a "Channel::Funded" when we want to bump the fee on an interactively
84138413 // constructed funding tx or during splicing. For now we send an error as we would
84148414 // never ack an RBF attempt or a splice for now:
8415- try_chan_phase_entry !(self, peer_state, Err(ChannelError::Warn(
8415+ try_channel_entry !(self, peer_state, Err(ChannelError::Warn(
84168416 "Got an unexpected tx_abort message: After initial funding transaction is signed, \
84178417 splicing and RBF attempts of interactive funding transactions are not supported yet so \
84188418 we don't have any negotiation in progress".into(),
84198419 )), chan_phase_entry)
84208420 } else {
8421- try_chan_phase_entry !(self, peer_state, Err(ChannelError::Warn(
8421+ try_channel_entry !(self, peer_state, Err(ChannelError::Warn(
84228422 "Got an unexpected tx_abort message: This is an unfunded channel created with V1 channel \
84238423 establishment".into(),
84248424 )), chan_phase_entry)
@@ -8468,7 +8468,7 @@ This indicates a bug inside LDK. Please report this error at https://github.com/
84688468 hash_map::Entry::Occupied(mut chan_phase_entry) => {
84698469 if let Some(chan) = chan_phase_entry.get_mut().as_funded_mut() {
84708470 let logger = WithChannelContext::from(&self.logger, &chan.context, None);
8471- let announcement_sigs_opt = try_chan_phase_entry !(self, peer_state, chan.channel_ready(&msg, &self.node_signer,
8471+ let announcement_sigs_opt = try_channel_entry !(self, peer_state, chan.channel_ready(&msg, &self.node_signer,
84728472 self.chain_hash, &self.default_configuration, &self.best_block.read().unwrap(), &&logger), chan_phase_entry);
84738473 if let Some(announcement_sigs) = announcement_sigs_opt {
84748474 log_trace!(logger, "Sending announcement_signatures for channel {}", chan.context.channel_id());
@@ -8498,7 +8498,7 @@ This indicates a bug inside LDK. Please report this error at https://github.com/
84988498
84998499 Ok(())
85008500 } else {
8501- try_chan_phase_entry !(self, peer_state, Err(ChannelError::close(
8501+ try_channel_entry !(self, peer_state, Err(ChannelError::close(
85028502 "Got a channel_ready message for an unfunded channel!".into())), chan_phase_entry)
85038503 }
85048504 },
@@ -8531,7 +8531,7 @@ This indicates a bug inside LDK. Please report this error at https://github.com/
85318531 }
85328532
85338533 let funding_txo_opt = chan.context.get_funding_txo();
8534- let (shutdown, monitor_update_opt, htlcs) = try_chan_phase_entry !(self, peer_state,
8534+ let (shutdown, monitor_update_opt, htlcs) = try_channel_entry !(self, peer_state,
85358535 chan.shutdown(&self.signer_provider, &peer_state.latest_features, &msg), chan_phase_entry);
85368536 dropped_htlcs = htlcs;
85378537
@@ -8589,7 +8589,7 @@ This indicates a bug inside LDK. Please report this error at https://github.com/
85898589 hash_map::Entry::Occupied(mut chan_phase_entry) => {
85908590 if let Some(chan) = chan_phase_entry.get_mut().as_funded_mut() {
85918591 let logger = WithChannelContext::from(&self.logger, &chan.context, None);
8592- let (closing_signed, tx, shutdown_result) = try_chan_phase_entry !(self, peer_state, chan.closing_signed(&self.fee_estimator, &msg, &&logger), chan_phase_entry);
8592+ let (closing_signed, tx, shutdown_result) = try_channel_entry !(self, peer_state, chan.closing_signed(&self.fee_estimator, &msg, &&logger), chan_phase_entry);
85938593 debug_assert_eq!(shutdown_result.is_some(), chan.is_shutdown());
85948594 if let Some(msg) = closing_signed {
85958595 peer_state.pending_msg_events.push(events::MessageSendEvent::SendClosingSigned {
@@ -8611,7 +8611,7 @@ This indicates a bug inside LDK. Please report this error at https://github.com/
86118611 (tx, None, None)
86128612 }
86138613 } else {
8614- return try_chan_phase_entry !(self, peer_state, Err(ChannelError::close(
8614+ return try_channel_entry !(self, peer_state, Err(ChannelError::close(
86158615 "Got a closing_signed message for an unfunded channel!".into())), chan_phase_entry);
86168616 }
86178617 },
@@ -8662,9 +8662,9 @@ This indicates a bug inside LDK. Please report this error at https://github.com/
86628662 match peer_state.channel_by_id.entry(msg.channel_id) {
86638663 hash_map::Entry::Occupied(mut chan_phase_entry) => {
86648664 if let Some(chan) = chan_phase_entry.get_mut().as_funded_mut() {
8665- try_chan_phase_entry !(self, peer_state, chan.update_add_htlc(&msg, &self.fee_estimator), chan_phase_entry);
8665+ try_channel_entry !(self, peer_state, chan.update_add_htlc(&msg, &self.fee_estimator), chan_phase_entry);
86668666 } else {
8667- return try_chan_phase_entry !(self, peer_state, Err(ChannelError::close(
8667+ return try_channel_entry !(self, peer_state, Err(ChannelError::close(
86688668 "Got an update_add_htlc message for an unfunded channel!".into())), chan_phase_entry);
86698669 }
86708670 },
@@ -8688,7 +8688,7 @@ This indicates a bug inside LDK. Please report this error at https://github.com/
86888688 match peer_state.channel_by_id.entry(msg.channel_id) {
86898689 hash_map::Entry::Occupied(mut chan_phase_entry) => {
86908690 if let Some(chan) = chan_phase_entry.get_mut().as_funded_mut() {
8691- let res = try_chan_phase_entry !(self, peer_state, chan.update_fulfill_htlc(&msg), chan_phase_entry);
8691+ let res = try_channel_entry !(self, peer_state, chan.update_fulfill_htlc(&msg), chan_phase_entry);
86928692 if let HTLCSource::PreviousHopData(prev_hop) = &res.0 {
86938693 let logger = WithChannelContext::from(&self.logger, &chan.context, None);
86948694 log_trace!(logger,
@@ -8708,7 +8708,7 @@ This indicates a bug inside LDK. Please report this error at https://github.com/
87088708 next_user_channel_id = chan.context.get_user_id();
87098709 res
87108710 } else {
8711- return try_chan_phase_entry !(self, peer_state, Err(ChannelError::close(
8711+ return try_channel_entry !(self, peer_state, Err(ChannelError::close(
87128712 "Got an update_fulfill_htlc message for an unfunded channel!".into())), chan_phase_entry);
87138713 }
87148714 },
@@ -8737,9 +8737,9 @@ This indicates a bug inside LDK. Please report this error at https://github.com/
87378737 match peer_state.channel_by_id.entry(msg.channel_id) {
87388738 hash_map::Entry::Occupied(mut chan_phase_entry) => {
87398739 if let Some(chan) = chan_phase_entry.get_mut().as_funded_mut() {
8740- try_chan_phase_entry !(self, peer_state, chan.update_fail_htlc(&msg, HTLCFailReason::from_msg(msg)), chan_phase_entry);
8740+ try_channel_entry !(self, peer_state, chan.update_fail_htlc(&msg, HTLCFailReason::from_msg(msg)), chan_phase_entry);
87418741 } else {
8742- return try_chan_phase_entry !(self, peer_state, Err(ChannelError::close(
8742+ return try_channel_entry !(self, peer_state, Err(ChannelError::close(
87438743 "Got an update_fail_htlc message for an unfunded channel!".into())), chan_phase_entry);
87448744 }
87458745 },
@@ -8763,12 +8763,12 @@ This indicates a bug inside LDK. Please report this error at https://github.com/
87638763 hash_map::Entry::Occupied(mut chan_phase_entry) => {
87648764 if (msg.failure_code & 0x8000) == 0 {
87658765 let chan_err = ChannelError::close("Got update_fail_malformed_htlc with BADONION not set".to_owned());
8766- try_chan_phase_entry !(self, peer_state, Err(chan_err), chan_phase_entry);
8766+ try_channel_entry !(self, peer_state, Err(chan_err), chan_phase_entry);
87678767 }
87688768 if let Some(chan) = chan_phase_entry.get_mut().as_funded_mut() {
8769- try_chan_phase_entry !(self, peer_state, chan.update_fail_malformed_htlc(&msg, HTLCFailReason::reason(msg.failure_code, msg.sha256_of_onion.to_vec())), chan_phase_entry);
8769+ try_channel_entry !(self, peer_state, chan.update_fail_malformed_htlc(&msg, HTLCFailReason::reason(msg.failure_code, msg.sha256_of_onion.to_vec())), chan_phase_entry);
87708770 } else {
8771- return try_chan_phase_entry !(self, peer_state, Err(ChannelError::close(
8771+ return try_channel_entry !(self, peer_state, Err(ChannelError::close(
87728772 "Got an update_fail_malformed_htlc message for an unfunded channel!".into())), chan_phase_entry);
87738773 }
87748774 Ok(())
@@ -8794,7 +8794,7 @@ This indicates a bug inside LDK. Please report this error at https://github.com/
87948794 let funding_txo = chan.context.get_funding_txo();
87958795
87968796 if chan.interactive_tx_signing_session.is_some() {
8797- let monitor = try_chan_phase_entry !(
8797+ let monitor = try_channel_entry !(
87988798 self, peer_state, chan.commitment_signed_initial_v2(msg, best_block, &self.signer_provider, &&logger),
87998799 chan_phase_entry);
88008800 let monitor_res = self.chain_monitor.watch_channel(monitor.get_funding_txo().0, monitor);
@@ -8804,15 +8804,15 @@ This indicates a bug inside LDK. Please report this error at https://github.com/
88048804 } else {
88058805 let logger = WithChannelContext::from(&self.logger, &chan.context, None);
88068806 log_error!(logger, "Persisting initial ChannelMonitor failed, implying the funding outpoint was duplicated");
8807- try_chan_phase_entry !(self, peer_state, Err(ChannelError::Close(
8807+ try_channel_entry !(self, peer_state, Err(ChannelError::Close(
88088808 (
88098809 "Channel funding outpoint was a duplicate".to_owned(),
88108810 ClosureReason::HolderForceClosed { broadcasted_latest_txn: Some(false) },
88118811 )
88128812 )), chan_phase_entry)
88138813 }
88148814 } else {
8815- let monitor_update_opt = try_chan_phase_entry !(
8815+ let monitor_update_opt = try_channel_entry !(
88168816 self, peer_state, chan.commitment_signed(msg, &&logger), chan_phase_entry);
88178817 if let Some(monitor_update) = monitor_update_opt {
88188818 handle_new_monitor_update!(self, funding_txo.unwrap(), monitor_update, peer_state_lock,
@@ -8821,7 +8821,7 @@ This indicates a bug inside LDK. Please report this error at https://github.com/
88218821 }
88228822 Ok(())
88238823 } else {
8824- return try_chan_phase_entry !(self, peer_state, Err(ChannelError::close(
8824+ return try_channel_entry !(self, peer_state, Err(ChannelError::close(
88258825 "Got a commitment_signed message for an unfunded channel!".into())), chan_phase_entry);
88268826 }
88278827 },
@@ -9014,7 +9014,7 @@ This indicates a bug inside LDK. Please report this error at https://github.com/
90149014 &peer_state.actions_blocking_raa_monitor_updates, funding_txo, msg.channel_id,
90159015 *counterparty_node_id)
90169016 } else { false };
9017- let (htlcs_to_fail, monitor_update_opt) = try_chan_phase_entry !(self, peer_state,
9017+ let (htlcs_to_fail, monitor_update_opt) = try_channel_entry !(self, peer_state,
90189018 chan.revoke_and_ack(&msg, &self.fee_estimator, &&logger, mon_update_blocked), chan_phase_entry);
90199019 if let Some(monitor_update) = monitor_update_opt {
90209020 let funding_txo = funding_txo_opt
@@ -9024,7 +9024,7 @@ This indicates a bug inside LDK. Please report this error at https://github.com/
90249024 }
90259025 htlcs_to_fail
90269026 } else {
9027- return try_chan_phase_entry !(self, peer_state, Err(ChannelError::close(
9027+ return try_channel_entry !(self, peer_state, Err(ChannelError::close(
90289028 "Got a revoke_and_ack message for an unfunded channel!".into())), chan_phase_entry);
90299029 }
90309030 },
@@ -9048,9 +9048,9 @@ This indicates a bug inside LDK. Please report this error at https://github.com/
90489048 hash_map::Entry::Occupied(mut chan_phase_entry) => {
90499049 if let Some(chan) = chan_phase_entry.get_mut().as_funded_mut() {
90509050 let logger = WithChannelContext::from(&self.logger, &chan.context, None);
9051- try_chan_phase_entry !(self, peer_state, chan.update_fee(&self.fee_estimator, &msg, &&logger), chan_phase_entry);
9051+ try_channel_entry !(self, peer_state, chan.update_fee(&self.fee_estimator, &msg, &&logger), chan_phase_entry);
90529052 } else {
9053- return try_chan_phase_entry !(self, peer_state, Err(ChannelError::close(
9053+ return try_channel_entry !(self, peer_state, Err(ChannelError::close(
90549054 "Got an update_fee message for an unfunded channel!".into())), chan_phase_entry);
90559055 }
90569056 },
@@ -9076,7 +9076,7 @@ This indicates a bug inside LDK. Please report this error at https://github.com/
90769076 }
90779077
90789078 peer_state.pending_msg_events.push(events::MessageSendEvent::BroadcastChannelAnnouncement {
9079- msg: try_chan_phase_entry !(self, peer_state, chan.announcement_signatures(
9079+ msg: try_channel_entry !(self, peer_state, chan.announcement_signatures(
90809080 &self.node_signer, self.chain_hash, self.best_block.read().unwrap().height,
90819081 msg, &self.default_configuration
90829082 ), chan_phase_entry),
@@ -9085,7 +9085,7 @@ This indicates a bug inside LDK. Please report this error at https://github.com/
90859085 update_msg: Some(self.get_channel_update_for_broadcast(chan).unwrap()),
90869086 });
90879087 } else {
9088- return try_chan_phase_entry !(self, peer_state, Err(ChannelError::close(
9088+ return try_channel_entry !(self, peer_state, Err(ChannelError::close(
90899089 "Got an announcement_signatures message for an unfunded channel!".into())), chan_phase_entry);
90909090 }
90919091 },
@@ -9129,15 +9129,15 @@ This indicates a bug inside LDK. Please report this error at https://github.com/
91299129 } else {
91309130 let logger = WithChannelContext::from(&self.logger, &chan.context, None);
91319131 log_debug!(logger, "Received channel_update {:?} for channel {}.", msg, chan_id);
9132- let did_change = try_chan_phase_entry !(self, peer_state, chan.channel_update(&msg), chan_phase_entry);
9132+ let did_change = try_channel_entry !(self, peer_state, chan.channel_update(&msg), chan_phase_entry);
91339133 // If nothing changed after applying their update, we don't need to bother
91349134 // persisting.
91359135 if !did_change {
91369136 return Ok(NotifyOption::SkipPersistNoEvents);
91379137 }
91389138 }
91399139 } else {
9140- return try_chan_phase_entry !(self, peer_state, Err(ChannelError::close(
9140+ return try_channel_entry !(self, peer_state, Err(ChannelError::close(
91419141 "Got a channel_update for an unfunded channel!".into())), chan_phase_entry);
91429142 }
91439143 },
@@ -9168,7 +9168,7 @@ This indicates a bug inside LDK. Please report this error at https://github.com/
91689168 // disconnect, so Channel's reestablish will never hand us any holding cell
91699169 // freed HTLCs to fail backwards. If in the future we no longer drop pending
91709170 // add-HTLCs on disconnect, we may be handed HTLCs to fail backwards here.
9171- let responses = try_chan_phase_entry !(self, peer_state, chan.channel_reestablish(
9171+ let responses = try_channel_entry !(self, peer_state, chan.channel_reestablish(
91729172 msg, &&logger, &self.node_signer, self.chain_hash,
91739173 &self.default_configuration, &*self.best_block.read().unwrap()), chan_phase_entry);
91749174 let mut channel_update = None;
@@ -9199,7 +9199,7 @@ This indicates a bug inside LDK. Please report this error at https://github.com/
91999199 }
92009200 need_lnd_workaround
92019201 } else {
9202- return try_chan_phase_entry !(self, peer_state, Err(ChannelError::close(
9202+ return try_channel_entry !(self, peer_state, Err(ChannelError::close(
92039203 "Got a channel_reestablish message for an unfunded channel!".into())), chan_phase_entry);
92049204 }
92059205 },
0 commit comments