@@ -9859,23 +9859,31 @@ where
9859
9859
});
9860
9860
}
9861
9861
9862
- #[cfg(any(dual_funding, splicing))]
9863
9862
fn handle_open_channel_v2(&self, counterparty_node_id: &PublicKey, msg: &msgs::OpenChannelV2) {
9864
- // Note that we never need to persist the updated ChannelManager for an inbound
9865
- // open_channel message - pre-funded channels are never written so there should be no
9866
- // change to the contents.
9867
- let _persistence_guard = PersistenceNotifierGuard::optionally_notify(self, || {
9868
- let res = self.internal_open_channel(counterparty_node_id, OpenChannelMessage::V2(msg.clone()));
9869
- let persist = match &res {
9870
- Err(e) if e.closes_channel() => {
9871
- debug_assert!(false, "We shouldn't close a new channel");
9872
- NotifyOption::DoPersist
9873
- },
9874
- _ => NotifyOption::SkipPersistHandleEvents,
9875
- };
9876
- let _ = handle_error!(self, res, *counterparty_node_id);
9877
- persist
9878
- });
9863
+ #[cfg(any(dual_funding, splicing))]
9864
+ {
9865
+ // Note that we never need to persist the updated ChannelManager for an inbound
9866
+ // open_channel message - pre-funded channels are never written so there should be no
9867
+ // change to the contents.
9868
+ let _persistence_guard = PersistenceNotifierGuard::optionally_notify(self, || {
9869
+ let res = self.internal_open_channel(counterparty_node_id, OpenChannelMessage::V2(msg.clone()));
9870
+ let persist = match &res {
9871
+ Err(e) if e.closes_channel() => {
9872
+ debug_assert!(false, "We shouldn't close a new channel");
9873
+ NotifyOption::DoPersist
9874
+ },
9875
+ _ => NotifyOption::SkipPersistHandleEvents,
9876
+ };
9877
+ let _ = handle_error!(self, res, *counterparty_node_id);
9878
+ persist
9879
+ });
9880
+ };
9881
+ #[cfg(not(any(dual_funding, splicing)))]
9882
+ {
9883
+ let _: Result<(), _> = handle_error!(self, Err(MsgHandleErrInternal::send_err_msg_no_close(
9884
+ "Dual-funded channels not supported".to_owned(),
9885
+ msg.common_fields.temporary_channel_id.clone())), *counterparty_node_id);
9886
+ };
9879
9887
}
9880
9888
9881
9889
fn handle_accept_channel(&self, counterparty_node_id: &PublicKey, msg: &msgs::AcceptChannel) {
@@ -9888,7 +9896,6 @@ where
9888
9896
});
9889
9897
}
9890
9898
9891
- #[cfg(any(dual_funding, splicing))]
9892
9899
fn handle_accept_channel_v2(&self, counterparty_node_id: &PublicKey, msg: &msgs::AcceptChannelV2) {
9893
9900
let _: Result<(), _> = handle_error!(self, Err(MsgHandleErrInternal::send_err_msg_no_close(
9894
9901
"Dual-funded channels not supported".to_owned(),
@@ -10420,83 +10427,119 @@ where
10420
10427
Some(vec![self.chain_hash])
10421
10428
}
10422
10429
10423
- #[cfg(any(dual_funding, splicing))]
10424
10430
fn handle_tx_add_input(&self, counterparty_node_id: &PublicKey, msg: &msgs::TxAddInput) {
10425
- // Note that we never need to persist the updated ChannelManager for an inbound
10426
- // tx_add_input message - interactive transaction construction does not need to
10427
- // be persisted before any signatures are exchanged.
10428
- let _persistence_guard = PersistenceNotifierGuard::optionally_notify(self, || {
10429
- let _ = handle_error!(self, self.internal_tx_add_input(counterparty_node_id, msg), *counterparty_node_id);
10430
- NotifyOption::SkipPersistHandleEvents
10431
- });
10431
+ #[cfg(any(dual_funding, splicing))]
10432
+ {
10433
+ // Note that we never need to persist the updated ChannelManager for an inbound
10434
+ // tx_add_input message - interactive transaction construction does not need to
10435
+ // be persisted before any signatures are exchanged.
10436
+ let _persistence_guard = PersistenceNotifierGuard::optionally_notify(self, || {
10437
+ let _ = handle_error!(self, self.internal_tx_add_input(counterparty_node_id, msg), *counterparty_node_id);
10438
+ NotifyOption::SkipPersistHandleEvents
10439
+ });
10440
+ };
10441
+ #[cfg(not(any(dual_funding, splicing)))]
10442
+ {
10443
+ let _: Result<(), _> = handle_error!(self, Err(MsgHandleErrInternal::send_err_msg_no_close(
10444
+ "Dual-funded channels not supported".to_owned(),
10445
+ msg.channel_id.clone())), *counterparty_node_id);
10446
+ };
10432
10447
}
10433
10448
10434
- #[cfg(any(dual_funding, splicing))]
10435
10449
fn handle_tx_add_output(&self, counterparty_node_id: &PublicKey, msg: &msgs::TxAddOutput) {
10436
- // Note that we never need to persist the updated ChannelManager for an inbound
10437
- // tx_add_input message - interactive transaction construction does not need to
10438
- // be persisted before any signatures are exchanged.
10439
- let _persistence_guard = PersistenceNotifierGuard::optionally_notify(self, || {
10440
- let _ = handle_error!(self, self.internal_tx_add_output(counterparty_node_id, msg), *counterparty_node_id);
10441
- NotifyOption::SkipPersistHandleEvents
10442
- });
10450
+ #[cfg(any(dual_funding, splicing))]
10451
+ {
10452
+ // Note that we never need to persist the updated ChannelManager for an inbound
10453
+ // tx_add_input message - interactive transaction construction does not need to
10454
+ // be persisted before any signatures are exchanged.
10455
+ let _persistence_guard = PersistenceNotifierGuard::optionally_notify(self, || {
10456
+ let _ = handle_error!(self, self.internal_tx_add_output(counterparty_node_id, msg), *counterparty_node_id);
10457
+ NotifyOption::SkipPersistHandleEvents
10458
+ });
10459
+ };
10460
+ #[cfg(not(any(dual_funding, splicing)))]
10461
+ {
10462
+ let _: Result<(), _> = handle_error!(self, Err(MsgHandleErrInternal::send_err_msg_no_close(
10463
+ "Dual-funded channels not supported".to_owned(),
10464
+ msg.channel_id.clone())), *counterparty_node_id);
10465
+ };
10443
10466
}
10444
10467
10445
- #[cfg(any(dual_funding, splicing))]
10446
10468
fn handle_tx_remove_input(&self, counterparty_node_id: &PublicKey, msg: &msgs::TxRemoveInput) {
10447
- // Note that we never need to persist the updated ChannelManager for an inbound
10448
- // tx_add_input message - interactive transaction construction does not need to
10449
- // be persisted before any signatures are exchanged.
10450
- let _persistence_guard = PersistenceNotifierGuard::optionally_notify(self, || {
10451
- let _ = handle_error!(self, self.internal_tx_remove_input(counterparty_node_id, msg), *counterparty_node_id);
10452
- NotifyOption::SkipPersistHandleEvents
10453
- });
10469
+ #[cfg(any(dual_funding, splicing))]
10470
+ {
10471
+ // Note that we never need to persist the updated ChannelManager for an inbound
10472
+ // tx_add_input message - interactive transaction construction does not need to
10473
+ // be persisted before any signatures are exchanged.
10474
+ let _persistence_guard = PersistenceNotifierGuard::optionally_notify(self, || {
10475
+ let _ = handle_error!(self, self.internal_tx_remove_input(counterparty_node_id, msg), *counterparty_node_id);
10476
+ NotifyOption::SkipPersistHandleEvents
10477
+ });
10478
+ };
10479
+ #[cfg(not(any(dual_funding, splicing)))]
10480
+ {
10481
+ let _: Result<(), _> = handle_error!(self, Err(MsgHandleErrInternal::send_err_msg_no_close(
10482
+ "Dual-funded channels not supported".to_owned(),
10483
+ msg.channel_id.clone())), *counterparty_node_id);
10484
+ };
10454
10485
}
10455
10486
10456
- #[cfg(any(dual_funding, splicing))]
10457
10487
fn handle_tx_remove_output(&self, counterparty_node_id: &PublicKey, msg: &msgs::TxRemoveOutput) {
10458
- // Note that we never need to persist the updated ChannelManager for an inbound
10459
- // tx_add_input message - interactive transaction construction does not need to
10460
- // be persisted before any signatures are exchanged.
10461
- let _persistence_guard = PersistenceNotifierGuard::optionally_notify(self, || {
10462
- let _ = handle_error!(self, self.internal_tx_remove_output(counterparty_node_id, msg), *counterparty_node_id);
10463
- NotifyOption::SkipPersistHandleEvents
10464
- });
10488
+ #[cfg(any(dual_funding, splicing))]
10489
+ {
10490
+ // Note that we never need to persist the updated ChannelManager for an inbound
10491
+ // tx_add_input message - interactive transaction construction does not need to
10492
+ // be persisted before any signatures are exchanged.
10493
+ let _persistence_guard = PersistenceNotifierGuard::optionally_notify(self, || {
10494
+ let _ = handle_error!(self, self.internal_tx_remove_output(counterparty_node_id, msg), *counterparty_node_id);
10495
+ NotifyOption::SkipPersistHandleEvents
10496
+ });
10497
+ };
10498
+ #[cfg(not(any(dual_funding, splicing)))]
10499
+ {
10500
+ let _: Result<(), _> = handle_error!(self, Err(MsgHandleErrInternal::send_err_msg_no_close(
10501
+ "Dual-funded channels not supported".to_owned(),
10502
+ msg.channel_id.clone())), *counterparty_node_id);
10503
+ };
10465
10504
}
10466
10505
10467
- #[cfg(any(dual_funding, splicing))]
10468
10506
fn handle_tx_complete(&self, counterparty_node_id: &PublicKey, msg: &msgs::TxComplete) {
10469
- // Note that we never need to persist the updated ChannelManager for an inbound
10470
- // tx_add_input message - interactive transaction construction does not need to
10471
- // be persisted before any signatures are exchanged.
10472
- let _persistence_guard = PersistenceNotifierGuard::optionally_notify(self, || {
10473
- let _ = handle_error!(self, self.internal_tx_complete(counterparty_node_id, msg), *counterparty_node_id);
10474
- NotifyOption::SkipPersistHandleEvents
10475
- });
10507
+ #[cfg(any(dual_funding, splicing))]
10508
+ {
10509
+ // Note that we never need to persist the updated ChannelManager for an inbound
10510
+ // tx_add_input message - interactive transaction construction does not need to
10511
+ // be persisted before any signatures are exchanged.
10512
+ let _persistence_guard = PersistenceNotifierGuard::optionally_notify(self, || {
10513
+ let _ = handle_error!(self, self.internal_tx_complete(counterparty_node_id, msg), *counterparty_node_id);
10514
+ NotifyOption::SkipPersistHandleEvents
10515
+ });
10516
+ };
10517
+ #[cfg(not(any(dual_funding, splicing)))]
10518
+ {
10519
+ let _: Result<(), _> = handle_error!(self, Err(MsgHandleErrInternal::send_err_msg_no_close(
10520
+ "Dual-funded channels not supported".to_owned(),
10521
+ msg.channel_id.clone())), *counterparty_node_id);
10522
+ };
10476
10523
}
10477
10524
10478
- #[cfg(any(dual_funding, splicing))]
10479
10525
fn handle_tx_signatures(&self, counterparty_node_id: &PublicKey, msg: &msgs::TxSignatures) {
10480
10526
let _: Result<(), _> = handle_error!(self, Err(MsgHandleErrInternal::send_err_msg_no_close(
10481
10527
"Dual-funded channels not supported".to_owned(),
10482
10528
msg.channel_id.clone())), *counterparty_node_id);
10483
10529
}
10484
10530
10485
- #[cfg(any(dual_funding, splicing))]
10486
10531
fn handle_tx_init_rbf(&self, counterparty_node_id: &PublicKey, msg: &msgs::TxInitRbf) {
10487
10532
let _: Result<(), _> = handle_error!(self, Err(MsgHandleErrInternal::send_err_msg_no_close(
10488
10533
"Dual-funded channels not supported".to_owned(),
10489
10534
msg.channel_id.clone())), *counterparty_node_id);
10490
10535
}
10491
10536
10492
- #[cfg(any(dual_funding, splicing))]
10493
10537
fn handle_tx_ack_rbf(&self, counterparty_node_id: &PublicKey, msg: &msgs::TxAckRbf) {
10494
10538
let _: Result<(), _> = handle_error!(self, Err(MsgHandleErrInternal::send_err_msg_no_close(
10495
10539
"Dual-funded channels not supported".to_owned(),
10496
10540
msg.channel_id.clone())), *counterparty_node_id);
10497
10541
}
10498
10542
10499
- #[cfg(any(dual_funding, splicing))]
10500
10543
fn handle_tx_abort(&self, counterparty_node_id: &PublicKey, msg: &msgs::TxAbort) {
10501
10544
let _: Result<(), _> = handle_error!(self, Err(MsgHandleErrInternal::send_err_msg_no_close(
10502
10545
"Dual-funded channels not supported".to_owned(),
0 commit comments