@@ -19,7 +19,7 @@ use crate::chain::channelmonitor::{ANTI_REORG_DELAY, ChannelMonitor};
19
19
use crate :: chain:: transaction:: OutPoint ;
20
20
use crate :: chain:: { ChannelMonitorUpdateStatus , Listen , Watch } ;
21
21
use crate :: events:: { Event , MessageSendEvent , MessageSendEventsProvider , PaymentPurpose , ClosureReason , HTLCDestination } ;
22
- use crate :: ln:: channelmanager:: { RAACommitmentOrder , PaymentSendFailure , PaymentId , RecipientOnionFields } ;
22
+ use crate :: ln:: channelmanager:: { PaymentId , PaymentSendFailure , RAACommitmentOrder , RAAMonitorUpdateBlockingAction , RecipientOnionFields } ;
23
23
use crate :: ln:: channel:: { AnnouncementSigsState , ChannelPhase } ;
24
24
use crate :: ln:: msgs;
25
25
use crate :: ln:: types:: ChannelId ;
@@ -3333,6 +3333,19 @@ fn do_test_durable_preimages_on_closed_channel(close_chans_before_reload: bool,
3333
3333
check_added_monitors ( & nodes[ 1 ] , 1 ) ;
3334
3334
assert ! ( nodes[ 1 ] . node. get_and_clear_pending_events( ) . is_empty( ) ) ;
3335
3335
send_payment ( & nodes[ 1 ] , & [ & nodes[ 2 ] ] , 100_000 ) ;
3336
+ } else {
3337
+ // Handle RAA blockers on nodes[1]
3338
+ let raa_blockers = nodes[ 1 ] . node . get_and_clear_pending_raa_blockers ( ) ;
3339
+ assert_eq ! ( raa_blockers. len( ) , 1 ) ;
3340
+ let ( chan_id, blockers) = & raa_blockers[ 0 ] ;
3341
+ assert_eq ! ( * chan_id, chan_id_bc) ;
3342
+ assert_eq ! ( blockers. len( ) , 1 ) ;
3343
+ match blockers[ 0 ] {
3344
+ RAAMonitorUpdateBlockingAction :: ForwardedPaymentInboundClaim { channel_id, .. } => {
3345
+ assert_eq ! ( channel_id, chan_id_ab) ;
3346
+ }
3347
+ _ => panic ! ( "Unexpected RAA blocker" )
3348
+ }
3336
3349
}
3337
3350
}
3338
3351
@@ -3548,8 +3561,8 @@ fn do_test_glacial_peer_cant_hang(hold_chan_a: bool) {
3548
3561
let node_chanmgrs = create_node_chanmgrs ( 3 , & node_cfgs, & [ None , None , None ] ) ;
3549
3562
let mut nodes = create_network ( 3 , & node_cfgs, & node_chanmgrs) ;
3550
3563
3551
- create_announced_chan_between_nodes ( & nodes, 0 , 1 ) ;
3552
- create_announced_chan_between_nodes ( & nodes, 1 , 2 ) ;
3564
+ let chan_id_ab = create_announced_chan_between_nodes ( & nodes, 0 , 1 ) . 2 ;
3565
+ let chan_id_bc = create_announced_chan_between_nodes ( & nodes, 1 , 2 ) . 2 ;
3553
3566
3554
3567
// Route a payment from A, through B, to C, then claim it on C. Replay the
3555
3568
// `update_fulfill_htlc` twice on B to check that B doesn't hang.
@@ -3596,6 +3609,19 @@ fn do_test_glacial_peer_cant_hang(hold_chan_a: bool) {
3596
3609
3597
3610
assert ! ( nodes[ 1 ] . node. get_and_clear_pending_events( ) . is_empty( ) ) ;
3598
3611
assert ! ( nodes[ 1 ] . node. get_and_clear_pending_msg_events( ) . is_empty( ) ) ;
3612
+
3613
+ // Handle RAA blockers on nodes[1]
3614
+ let raa_blockers = nodes[ 1 ] . node . get_and_clear_pending_raa_blockers ( ) ;
3615
+ assert_eq ! ( raa_blockers. len( ) , 1 ) ;
3616
+ let ( chan_id, blockers) = & raa_blockers[ 0 ] ;
3617
+ assert_eq ! ( * chan_id, chan_id_bc) ;
3618
+ assert_eq ! ( blockers. len( ) , 1 ) ;
3619
+ match blockers[ 0 ] {
3620
+ RAAMonitorUpdateBlockingAction :: ForwardedPaymentInboundClaim { channel_id, .. } => {
3621
+ assert_eq ! ( channel_id, chan_id_ab) ;
3622
+ }
3623
+ _ => panic ! ( "Unexpected RAA blocker" )
3624
+ }
3599
3625
}
3600
3626
}
3601
3627
0 commit comments