@@ -10022,23 +10022,31 @@ where
10022
10022
});
10023
10023
}
10024
10024
10025
- #[cfg(any(dual_funding, splicing))]
10026
10025
fn handle_open_channel_v2(&self, counterparty_node_id: &PublicKey, msg: &msgs::OpenChannelV2) {
10027
- // Note that we never need to persist the updated ChannelManager for an inbound
10028
- // open_channel message - pre-funded channels are never written so there should be no
10029
- // change to the contents.
10030
- let _persistence_guard = PersistenceNotifierGuard::optionally_notify(self, || {
10031
- let res = self.internal_open_channel(counterparty_node_id, OpenChannelMessage::V2(msg.clone()));
10032
- let persist = match &res {
10033
- Err(e) if e.closes_channel() => {
10034
- debug_assert!(false, "We shouldn't close a new channel");
10035
- NotifyOption::DoPersist
10036
- },
10037
- _ => NotifyOption::SkipPersistHandleEvents,
10038
- };
10039
- let _ = handle_error!(self, res, *counterparty_node_id);
10040
- persist
10041
- });
10026
+ #[cfg(any(dual_funding, splicing))]
10027
+ {
10028
+ // Note that we never need to persist the updated ChannelManager for an inbound
10029
+ // open_channel message - pre-funded channels are never written so there should be no
10030
+ // change to the contents.
10031
+ let _persistence_guard = PersistenceNotifierGuard::optionally_notify(self, || {
10032
+ let res = self.internal_open_channel(counterparty_node_id, OpenChannelMessage::V2(msg.clone()));
10033
+ let persist = match &res {
10034
+ Err(e) if e.closes_channel() => {
10035
+ debug_assert!(false, "We shouldn't close a new channel");
10036
+ NotifyOption::DoPersist
10037
+ },
10038
+ _ => NotifyOption::SkipPersistHandleEvents,
10039
+ };
10040
+ let _ = handle_error!(self, res, *counterparty_node_id);
10041
+ persist
10042
+ });
10043
+ };
10044
+ #[cfg(not(any(dual_funding, splicing)))]
10045
+ {
10046
+ let _: Result<(), _> = handle_error!(self, Err(MsgHandleErrInternal::send_err_msg_no_close(
10047
+ "Dual-funded channels not supported".to_owned(),
10048
+ msg.common_fields.temporary_channel_id.clone())), *counterparty_node_id);
10049
+ };
10042
10050
}
10043
10051
10044
10052
fn handle_accept_channel(&self, counterparty_node_id: &PublicKey, msg: &msgs::AcceptChannel) {
@@ -10051,7 +10059,6 @@ where
10051
10059
});
10052
10060
}
10053
10061
10054
- #[cfg(any(dual_funding, splicing))]
10055
10062
fn handle_accept_channel_v2(&self, counterparty_node_id: &PublicKey, msg: &msgs::AcceptChannelV2) {
10056
10063
let _: Result<(), _> = handle_error!(self, Err(MsgHandleErrInternal::send_err_msg_no_close(
10057
10064
"Dual-funded channels not supported".to_owned(),
@@ -10583,83 +10590,119 @@ where
10583
10590
Some(vec![self.chain_hash])
10584
10591
}
10585
10592
10586
- #[cfg(any(dual_funding, splicing))]
10587
10593
fn handle_tx_add_input(&self, counterparty_node_id: &PublicKey, msg: &msgs::TxAddInput) {
10588
- // Note that we never need to persist the updated ChannelManager for an inbound
10589
- // tx_add_input message - interactive transaction construction does not need to
10590
- // be persisted before any signatures are exchanged.
10591
- let _persistence_guard = PersistenceNotifierGuard::optionally_notify(self, || {
10592
- let _ = handle_error!(self, self.internal_tx_add_input(counterparty_node_id, msg), *counterparty_node_id);
10593
- NotifyOption::SkipPersistHandleEvents
10594
- });
10594
+ #[cfg(any(dual_funding, splicing))]
10595
+ {
10596
+ // Note that we never need to persist the updated ChannelManager for an inbound
10597
+ // tx_add_input message - interactive transaction construction does not need to
10598
+ // be persisted before any signatures are exchanged.
10599
+ let _persistence_guard = PersistenceNotifierGuard::optionally_notify(self, || {
10600
+ let _ = handle_error!(self, self.internal_tx_add_input(counterparty_node_id, msg), *counterparty_node_id);
10601
+ NotifyOption::SkipPersistHandleEvents
10602
+ });
10603
+ };
10604
+ #[cfg(not(any(dual_funding, splicing)))]
10605
+ {
10606
+ let _: Result<(), _> = handle_error!(self, Err(MsgHandleErrInternal::send_err_msg_no_close(
10607
+ "Dual-funded channels not supported".to_owned(),
10608
+ msg.channel_id.clone())), *counterparty_node_id);
10609
+ };
10595
10610
}
10596
10611
10597
- #[cfg(any(dual_funding, splicing))]
10598
10612
fn handle_tx_add_output(&self, counterparty_node_id: &PublicKey, msg: &msgs::TxAddOutput) {
10599
- // Note that we never need to persist the updated ChannelManager for an inbound
10600
- // tx_add_input message - interactive transaction construction does not need to
10601
- // be persisted before any signatures are exchanged.
10602
- let _persistence_guard = PersistenceNotifierGuard::optionally_notify(self, || {
10603
- let _ = handle_error!(self, self.internal_tx_add_output(counterparty_node_id, msg), *counterparty_node_id);
10604
- NotifyOption::SkipPersistHandleEvents
10605
- });
10613
+ #[cfg(any(dual_funding, splicing))]
10614
+ {
10615
+ // Note that we never need to persist the updated ChannelManager for an inbound
10616
+ // tx_add_input message - interactive transaction construction does not need to
10617
+ // be persisted before any signatures are exchanged.
10618
+ let _persistence_guard = PersistenceNotifierGuard::optionally_notify(self, || {
10619
+ let _ = handle_error!(self, self.internal_tx_add_output(counterparty_node_id, msg), *counterparty_node_id);
10620
+ NotifyOption::SkipPersistHandleEvents
10621
+ });
10622
+ };
10623
+ #[cfg(not(any(dual_funding, splicing)))]
10624
+ {
10625
+ let _: Result<(), _> = handle_error!(self, Err(MsgHandleErrInternal::send_err_msg_no_close(
10626
+ "Dual-funded channels not supported".to_owned(),
10627
+ msg.channel_id.clone())), *counterparty_node_id);
10628
+ };
10606
10629
}
10607
10630
10608
- #[cfg(any(dual_funding, splicing))]
10609
10631
fn handle_tx_remove_input(&self, counterparty_node_id: &PublicKey, msg: &msgs::TxRemoveInput) {
10610
- // Note that we never need to persist the updated ChannelManager for an inbound
10611
- // tx_add_input message - interactive transaction construction does not need to
10612
- // be persisted before any signatures are exchanged.
10613
- let _persistence_guard = PersistenceNotifierGuard::optionally_notify(self, || {
10614
- let _ = handle_error!(self, self.internal_tx_remove_input(counterparty_node_id, msg), *counterparty_node_id);
10615
- NotifyOption::SkipPersistHandleEvents
10616
- });
10632
+ #[cfg(any(dual_funding, splicing))]
10633
+ {
10634
+ // Note that we never need to persist the updated ChannelManager for an inbound
10635
+ // tx_add_input message - interactive transaction construction does not need to
10636
+ // be persisted before any signatures are exchanged.
10637
+ let _persistence_guard = PersistenceNotifierGuard::optionally_notify(self, || {
10638
+ let _ = handle_error!(self, self.internal_tx_remove_input(counterparty_node_id, msg), *counterparty_node_id);
10639
+ NotifyOption::SkipPersistHandleEvents
10640
+ });
10641
+ };
10642
+ #[cfg(not(any(dual_funding, splicing)))]
10643
+ {
10644
+ let _: Result<(), _> = handle_error!(self, Err(MsgHandleErrInternal::send_err_msg_no_close(
10645
+ "Dual-funded channels not supported".to_owned(),
10646
+ msg.channel_id.clone())), *counterparty_node_id);
10647
+ };
10617
10648
}
10618
10649
10619
- #[cfg(any(dual_funding, splicing))]
10620
10650
fn handle_tx_remove_output(&self, counterparty_node_id: &PublicKey, msg: &msgs::TxRemoveOutput) {
10621
- // Note that we never need to persist the updated ChannelManager for an inbound
10622
- // tx_add_input message - interactive transaction construction does not need to
10623
- // be persisted before any signatures are exchanged.
10624
- let _persistence_guard = PersistenceNotifierGuard::optionally_notify(self, || {
10625
- let _ = handle_error!(self, self.internal_tx_remove_output(counterparty_node_id, msg), *counterparty_node_id);
10626
- NotifyOption::SkipPersistHandleEvents
10627
- });
10651
+ #[cfg(any(dual_funding, splicing))]
10652
+ {
10653
+ // Note that we never need to persist the updated ChannelManager for an inbound
10654
+ // tx_add_input message - interactive transaction construction does not need to
10655
+ // be persisted before any signatures are exchanged.
10656
+ let _persistence_guard = PersistenceNotifierGuard::optionally_notify(self, || {
10657
+ let _ = handle_error!(self, self.internal_tx_remove_output(counterparty_node_id, msg), *counterparty_node_id);
10658
+ NotifyOption::SkipPersistHandleEvents
10659
+ });
10660
+ };
10661
+ #[cfg(not(any(dual_funding, splicing)))]
10662
+ {
10663
+ let _: Result<(), _> = handle_error!(self, Err(MsgHandleErrInternal::send_err_msg_no_close(
10664
+ "Dual-funded channels not supported".to_owned(),
10665
+ msg.channel_id.clone())), *counterparty_node_id);
10666
+ };
10628
10667
}
10629
10668
10630
- #[cfg(any(dual_funding, splicing))]
10631
10669
fn handle_tx_complete(&self, counterparty_node_id: &PublicKey, msg: &msgs::TxComplete) {
10632
- // Note that we never need to persist the updated ChannelManager for an inbound
10633
- // tx_add_input message - interactive transaction construction does not need to
10634
- // be persisted before any signatures are exchanged.
10635
- let _persistence_guard = PersistenceNotifierGuard::optionally_notify(self, || {
10636
- let _ = handle_error!(self, self.internal_tx_complete(counterparty_node_id, msg), *counterparty_node_id);
10637
- NotifyOption::SkipPersistHandleEvents
10638
- });
10670
+ #[cfg(any(dual_funding, splicing))]
10671
+ {
10672
+ // Note that we never need to persist the updated ChannelManager for an inbound
10673
+ // tx_add_input message - interactive transaction construction does not need to
10674
+ // be persisted before any signatures are exchanged.
10675
+ let _persistence_guard = PersistenceNotifierGuard::optionally_notify(self, || {
10676
+ let _ = handle_error!(self, self.internal_tx_complete(counterparty_node_id, msg), *counterparty_node_id);
10677
+ NotifyOption::SkipPersistHandleEvents
10678
+ });
10679
+ };
10680
+ #[cfg(not(any(dual_funding, splicing)))]
10681
+ {
10682
+ let _: Result<(), _> = handle_error!(self, Err(MsgHandleErrInternal::send_err_msg_no_close(
10683
+ "Dual-funded channels not supported".to_owned(),
10684
+ msg.channel_id.clone())), *counterparty_node_id);
10685
+ };
10639
10686
}
10640
10687
10641
- #[cfg(any(dual_funding, splicing))]
10642
10688
fn handle_tx_signatures(&self, counterparty_node_id: &PublicKey, msg: &msgs::TxSignatures) {
10643
10689
let _: Result<(), _> = handle_error!(self, Err(MsgHandleErrInternal::send_err_msg_no_close(
10644
10690
"Dual-funded channels not supported".to_owned(),
10645
10691
msg.channel_id.clone())), *counterparty_node_id);
10646
10692
}
10647
10693
10648
- #[cfg(any(dual_funding, splicing))]
10649
10694
fn handle_tx_init_rbf(&self, counterparty_node_id: &PublicKey, msg: &msgs::TxInitRbf) {
10650
10695
let _: Result<(), _> = handle_error!(self, Err(MsgHandleErrInternal::send_err_msg_no_close(
10651
10696
"Dual-funded channels not supported".to_owned(),
10652
10697
msg.channel_id.clone())), *counterparty_node_id);
10653
10698
}
10654
10699
10655
- #[cfg(any(dual_funding, splicing))]
10656
10700
fn handle_tx_ack_rbf(&self, counterparty_node_id: &PublicKey, msg: &msgs::TxAckRbf) {
10657
10701
let _: Result<(), _> = handle_error!(self, Err(MsgHandleErrInternal::send_err_msg_no_close(
10658
10702
"Dual-funded channels not supported".to_owned(),
10659
10703
msg.channel_id.clone())), *counterparty_node_id);
10660
10704
}
10661
10705
10662
- #[cfg(any(dual_funding, splicing))]
10663
10706
fn handle_tx_abort(&self, counterparty_node_id: &PublicKey, msg: &msgs::TxAbort) {
10664
10707
let _: Result<(), _> = handle_error!(self, Err(MsgHandleErrInternal::send_err_msg_no_close(
10665
10708
"Dual-funded channels not supported".to_owned(),
0 commit comments