@@ -9993,23 +9993,31 @@ where
9993
9993
});
9994
9994
}
9995
9995
9996
- #[cfg(any(dual_funding, splicing))]
9997
9996
fn handle_open_channel_v2(&self, counterparty_node_id: &PublicKey, msg: &msgs::OpenChannelV2) {
9998
- // Note that we never need to persist the updated ChannelManager for an inbound
9999
- // open_channel message - pre-funded channels are never written so there should be no
10000
- // change to the contents.
10001
- let _persistence_guard = PersistenceNotifierGuard::optionally_notify(self, || {
10002
- let res = self.internal_open_channel(counterparty_node_id, OpenChannelMessage::V2(msg.clone()));
10003
- let persist = match &res {
10004
- Err(e) if e.closes_channel() => {
10005
- debug_assert!(false, "We shouldn't close a new channel");
10006
- NotifyOption::DoPersist
10007
- },
10008
- _ => NotifyOption::SkipPersistHandleEvents,
10009
- };
10010
- let _ = handle_error!(self, res, *counterparty_node_id);
10011
- persist
10012
- });
9997
+ #[cfg(any(dual_funding, splicing))]
9998
+ {
9999
+ // Note that we never need to persist the updated ChannelManager for an inbound
10000
+ // open_channel message - pre-funded channels are never written so there should be no
10001
+ // change to the contents.
10002
+ let _persistence_guard = PersistenceNotifierGuard::optionally_notify(self, || {
10003
+ let res = self.internal_open_channel(counterparty_node_id, OpenChannelMessage::V2(msg.clone()));
10004
+ let persist = match &res {
10005
+ Err(e) if e.closes_channel() => {
10006
+ debug_assert!(false, "We shouldn't close a new channel");
10007
+ NotifyOption::DoPersist
10008
+ },
10009
+ _ => NotifyOption::SkipPersistHandleEvents,
10010
+ };
10011
+ let _ = handle_error!(self, res, *counterparty_node_id);
10012
+ persist
10013
+ });
10014
+ };
10015
+ #[cfg(not(any(dual_funding, splicing)))]
10016
+ {
10017
+ let _: Result<(), _> = handle_error!(self, Err(MsgHandleErrInternal::send_err_msg_no_close(
10018
+ "Dual-funded channels not supported".to_owned(),
10019
+ msg.common_fields.temporary_channel_id.clone())), *counterparty_node_id);
10020
+ };
10013
10021
}
10014
10022
10015
10023
fn handle_accept_channel(&self, counterparty_node_id: &PublicKey, msg: &msgs::AcceptChannel) {
@@ -10022,7 +10030,6 @@ where
10022
10030
});
10023
10031
}
10024
10032
10025
- #[cfg(any(dual_funding, splicing))]
10026
10033
fn handle_accept_channel_v2(&self, counterparty_node_id: &PublicKey, msg: &msgs::AcceptChannelV2) {
10027
10034
let _: Result<(), _> = handle_error!(self, Err(MsgHandleErrInternal::send_err_msg_no_close(
10028
10035
"Dual-funded channels not supported".to_owned(),
@@ -10554,83 +10561,119 @@ where
10554
10561
Some(vec![self.chain_hash])
10555
10562
}
10556
10563
10557
- #[cfg(any(dual_funding, splicing))]
10558
10564
fn handle_tx_add_input(&self, counterparty_node_id: &PublicKey, msg: &msgs::TxAddInput) {
10559
- // Note that we never need to persist the updated ChannelManager for an inbound
10560
- // tx_add_input message - interactive transaction construction does not need to
10561
- // be persisted before any signatures are exchanged.
10562
- let _persistence_guard = PersistenceNotifierGuard::optionally_notify(self, || {
10563
- let _ = handle_error!(self, self.internal_tx_add_input(counterparty_node_id, msg), *counterparty_node_id);
10564
- NotifyOption::SkipPersistHandleEvents
10565
- });
10565
+ #[cfg(any(dual_funding, splicing))]
10566
+ {
10567
+ // Note that we never need to persist the updated ChannelManager for an inbound
10568
+ // tx_add_input message - interactive transaction construction does not need to
10569
+ // be persisted before any signatures are exchanged.
10570
+ let _persistence_guard = PersistenceNotifierGuard::optionally_notify(self, || {
10571
+ let _ = handle_error!(self, self.internal_tx_add_input(counterparty_node_id, msg), *counterparty_node_id);
10572
+ NotifyOption::SkipPersistHandleEvents
10573
+ });
10574
+ };
10575
+ #[cfg(not(any(dual_funding, splicing)))]
10576
+ {
10577
+ let _: Result<(), _> = handle_error!(self, Err(MsgHandleErrInternal::send_err_msg_no_close(
10578
+ "Dual-funded channels not supported".to_owned(),
10579
+ msg.channel_id.clone())), *counterparty_node_id);
10580
+ };
10566
10581
}
10567
10582
10568
- #[cfg(any(dual_funding, splicing))]
10569
10583
fn handle_tx_add_output(&self, counterparty_node_id: &PublicKey, msg: &msgs::TxAddOutput) {
10570
- // Note that we never need to persist the updated ChannelManager for an inbound
10571
- // tx_add_input message - interactive transaction construction does not need to
10572
- // be persisted before any signatures are exchanged.
10573
- let _persistence_guard = PersistenceNotifierGuard::optionally_notify(self, || {
10574
- let _ = handle_error!(self, self.internal_tx_add_output(counterparty_node_id, msg), *counterparty_node_id);
10575
- NotifyOption::SkipPersistHandleEvents
10576
- });
10584
+ #[cfg(any(dual_funding, splicing))]
10585
+ {
10586
+ // Note that we never need to persist the updated ChannelManager for an inbound
10587
+ // tx_add_input message - interactive transaction construction does not need to
10588
+ // be persisted before any signatures are exchanged.
10589
+ let _persistence_guard = PersistenceNotifierGuard::optionally_notify(self, || {
10590
+ let _ = handle_error!(self, self.internal_tx_add_output(counterparty_node_id, msg), *counterparty_node_id);
10591
+ NotifyOption::SkipPersistHandleEvents
10592
+ });
10593
+ };
10594
+ #[cfg(not(any(dual_funding, splicing)))]
10595
+ {
10596
+ let _: Result<(), _> = handle_error!(self, Err(MsgHandleErrInternal::send_err_msg_no_close(
10597
+ "Dual-funded channels not supported".to_owned(),
10598
+ msg.channel_id.clone())), *counterparty_node_id);
10599
+ };
10577
10600
}
10578
10601
10579
- #[cfg(any(dual_funding, splicing))]
10580
10602
fn handle_tx_remove_input(&self, counterparty_node_id: &PublicKey, msg: &msgs::TxRemoveInput) {
10581
- // Note that we never need to persist the updated ChannelManager for an inbound
10582
- // tx_add_input message - interactive transaction construction does not need to
10583
- // be persisted before any signatures are exchanged.
10584
- let _persistence_guard = PersistenceNotifierGuard::optionally_notify(self, || {
10585
- let _ = handle_error!(self, self.internal_tx_remove_input(counterparty_node_id, msg), *counterparty_node_id);
10586
- NotifyOption::SkipPersistHandleEvents
10587
- });
10603
+ #[cfg(any(dual_funding, splicing))]
10604
+ {
10605
+ // Note that we never need to persist the updated ChannelManager for an inbound
10606
+ // tx_add_input message - interactive transaction construction does not need to
10607
+ // be persisted before any signatures are exchanged.
10608
+ let _persistence_guard = PersistenceNotifierGuard::optionally_notify(self, || {
10609
+ let _ = handle_error!(self, self.internal_tx_remove_input(counterparty_node_id, msg), *counterparty_node_id);
10610
+ NotifyOption::SkipPersistHandleEvents
10611
+ });
10612
+ };
10613
+ #[cfg(not(any(dual_funding, splicing)))]
10614
+ {
10615
+ let _: Result<(), _> = handle_error!(self, Err(MsgHandleErrInternal::send_err_msg_no_close(
10616
+ "Dual-funded channels not supported".to_owned(),
10617
+ msg.channel_id.clone())), *counterparty_node_id);
10618
+ };
10588
10619
}
10589
10620
10590
- #[cfg(any(dual_funding, splicing))]
10591
10621
fn handle_tx_remove_output(&self, counterparty_node_id: &PublicKey, msg: &msgs::TxRemoveOutput) {
10592
- // Note that we never need to persist the updated ChannelManager for an inbound
10593
- // tx_add_input message - interactive transaction construction does not need to
10594
- // be persisted before any signatures are exchanged.
10595
- let _persistence_guard = PersistenceNotifierGuard::optionally_notify(self, || {
10596
- let _ = handle_error!(self, self.internal_tx_remove_output(counterparty_node_id, msg), *counterparty_node_id);
10597
- NotifyOption::SkipPersistHandleEvents
10598
- });
10622
+ #[cfg(any(dual_funding, splicing))]
10623
+ {
10624
+ // Note that we never need to persist the updated ChannelManager for an inbound
10625
+ // tx_add_input message - interactive transaction construction does not need to
10626
+ // be persisted before any signatures are exchanged.
10627
+ let _persistence_guard = PersistenceNotifierGuard::optionally_notify(self, || {
10628
+ let _ = handle_error!(self, self.internal_tx_remove_output(counterparty_node_id, msg), *counterparty_node_id);
10629
+ NotifyOption::SkipPersistHandleEvents
10630
+ });
10631
+ };
10632
+ #[cfg(not(any(dual_funding, splicing)))]
10633
+ {
10634
+ let _: Result<(), _> = handle_error!(self, Err(MsgHandleErrInternal::send_err_msg_no_close(
10635
+ "Dual-funded channels not supported".to_owned(),
10636
+ msg.channel_id.clone())), *counterparty_node_id);
10637
+ };
10599
10638
}
10600
10639
10601
- #[cfg(any(dual_funding, splicing))]
10602
10640
fn handle_tx_complete(&self, counterparty_node_id: &PublicKey, msg: &msgs::TxComplete) {
10603
- // Note that we never need to persist the updated ChannelManager for an inbound
10604
- // tx_add_input message - interactive transaction construction does not need to
10605
- // be persisted before any signatures are exchanged.
10606
- let _persistence_guard = PersistenceNotifierGuard::optionally_notify(self, || {
10607
- let _ = handle_error!(self, self.internal_tx_complete(counterparty_node_id, msg), *counterparty_node_id);
10608
- NotifyOption::SkipPersistHandleEvents
10609
- });
10641
+ #[cfg(any(dual_funding, splicing))]
10642
+ {
10643
+ // Note that we never need to persist the updated ChannelManager for an inbound
10644
+ // tx_add_input message - interactive transaction construction does not need to
10645
+ // be persisted before any signatures are exchanged.
10646
+ let _persistence_guard = PersistenceNotifierGuard::optionally_notify(self, || {
10647
+ let _ = handle_error!(self, self.internal_tx_complete(counterparty_node_id, msg), *counterparty_node_id);
10648
+ NotifyOption::SkipPersistHandleEvents
10649
+ });
10650
+ };
10651
+ #[cfg(not(any(dual_funding, splicing)))]
10652
+ {
10653
+ let _: Result<(), _> = handle_error!(self, Err(MsgHandleErrInternal::send_err_msg_no_close(
10654
+ "Dual-funded channels not supported".to_owned(),
10655
+ msg.channel_id.clone())), *counterparty_node_id);
10656
+ };
10610
10657
}
10611
10658
10612
- #[cfg(any(dual_funding, splicing))]
10613
10659
fn handle_tx_signatures(&self, counterparty_node_id: &PublicKey, msg: &msgs::TxSignatures) {
10614
10660
let _: Result<(), _> = handle_error!(self, Err(MsgHandleErrInternal::send_err_msg_no_close(
10615
10661
"Dual-funded channels not supported".to_owned(),
10616
10662
msg.channel_id.clone())), *counterparty_node_id);
10617
10663
}
10618
10664
10619
- #[cfg(any(dual_funding, splicing))]
10620
10665
fn handle_tx_init_rbf(&self, counterparty_node_id: &PublicKey, msg: &msgs::TxInitRbf) {
10621
10666
let _: Result<(), _> = handle_error!(self, Err(MsgHandleErrInternal::send_err_msg_no_close(
10622
10667
"Dual-funded channels not supported".to_owned(),
10623
10668
msg.channel_id.clone())), *counterparty_node_id);
10624
10669
}
10625
10670
10626
- #[cfg(any(dual_funding, splicing))]
10627
10671
fn handle_tx_ack_rbf(&self, counterparty_node_id: &PublicKey, msg: &msgs::TxAckRbf) {
10628
10672
let _: Result<(), _> = handle_error!(self, Err(MsgHandleErrInternal::send_err_msg_no_close(
10629
10673
"Dual-funded channels not supported".to_owned(),
10630
10674
msg.channel_id.clone())), *counterparty_node_id);
10631
10675
}
10632
10676
10633
- #[cfg(any(dual_funding, splicing))]
10634
10677
fn handle_tx_abort(&self, counterparty_node_id: &PublicKey, msg: &msgs::TxAbort) {
10635
10678
let _: Result<(), _> = handle_error!(self, Err(MsgHandleErrInternal::send_err_msg_no_close(
10636
10679
"Dual-funded channels not supported".to_owned(),
0 commit comments