@@ -5001,52 +5001,6 @@ mod tests {
5001
5001
assert ! ( nodes[ 2 ] . node. list_channels( ) . is_empty( ) ) ;
5002
5002
}
5003
5003
5004
- #[ test]
5005
- fn update_fee_async_shutdown ( ) {
5006
- // Test update_fee works after shutdown start if messages are delivered out-of-order
5007
- let nodes = create_network ( 2 ) ;
5008
- let chan_1 = create_announced_chan_between_nodes ( & nodes, 0 , 1 ) ;
5009
-
5010
- let starting_feerate = nodes[ 0 ] . node . channel_state . lock ( ) . unwrap ( ) . by_id . get ( & chan_1. 2 ) . unwrap ( ) . get_feerate ( ) ;
5011
- nodes[ 0 ] . node . update_fee ( chan_1. 2 . clone ( ) , starting_feerate + 20 ) . unwrap ( ) ;
5012
- check_added_monitors ! ( nodes[ 0 ] , 1 ) ;
5013
- let updates = get_htlc_update_msgs ! ( nodes[ 0 ] , nodes[ 1 ] . node. get_our_node_id( ) ) ;
5014
- assert ! ( updates. update_add_htlcs. is_empty( ) ) ;
5015
- assert ! ( updates. update_fulfill_htlcs. is_empty( ) ) ;
5016
- assert ! ( updates. update_fail_htlcs. is_empty( ) ) ;
5017
- assert ! ( updates. update_fail_malformed_htlcs. is_empty( ) ) ;
5018
- assert ! ( updates. update_fee. is_some( ) ) ;
5019
-
5020
- nodes[ 1 ] . node . close_channel ( & chan_1. 2 ) . unwrap ( ) ;
5021
- let node_1_shutdown = get_event_msg ! ( nodes[ 1 ] , MessageSendEvent :: SendShutdown , nodes[ 0 ] . node. get_our_node_id( ) ) ;
5022
- nodes[ 0 ] . node . handle_shutdown ( & nodes[ 1 ] . node . get_our_node_id ( ) , & node_1_shutdown) . unwrap ( ) ;
5023
- // Note that we don't actually test normative behavior here. The spec indicates we could
5024
- // actually send a closing_signed here, but is kinda unclear and could possibly be amended
5025
- // to require waiting on the full commitment dance before doing so (see
5026
- // https://github.com/lightningnetwork/lightning-rfc/issues/499). In any case, to avoid
5027
- // ambiguity, we should wait until after the full commitment dance to send closing_signed.
5028
- let node_0_shutdown = get_event_msg ! ( nodes[ 0 ] , MessageSendEvent :: SendShutdown , nodes[ 1 ] . node. get_our_node_id( ) ) ;
5029
-
5030
- nodes[ 1 ] . node . handle_update_fee ( & nodes[ 0 ] . node . get_our_node_id ( ) , & updates. update_fee . unwrap ( ) ) . unwrap ( ) ;
5031
- nodes[ 1 ] . node . handle_commitment_signed ( & nodes[ 0 ] . node . get_our_node_id ( ) , & updates. commitment_signed ) . unwrap ( ) ;
5032
- check_added_monitors ! ( nodes[ 1 ] , 1 ) ;
5033
- nodes[ 1 ] . node . handle_shutdown ( & nodes[ 0 ] . node . get_our_node_id ( ) , & node_0_shutdown) . unwrap ( ) ;
5034
- let node_0_closing_signed = commitment_signed_dance ! ( nodes[ 1 ] , nodes[ 0 ] , ( ) , false , true , true ) ;
5035
-
5036
- assert ! ( nodes[ 1 ] . node. get_and_clear_pending_msg_events( ) . is_empty( ) ) ;
5037
- nodes[ 1 ] . node . handle_closing_signed ( & nodes[ 0 ] . node . get_our_node_id ( ) , match node_0_closing_signed. unwrap ( ) {
5038
- MessageSendEvent :: SendClosingSigned { ref node_id, ref msg } => {
5039
- assert_eq ! ( * node_id, nodes[ 1 ] . node. get_our_node_id( ) ) ;
5040
- msg
5041
- } ,
5042
- _ => panic ! ( "Unexpected event" ) ,
5043
- } ) . unwrap ( ) ;
5044
- let ( _, node_1_closing_signed) = get_closing_signed_broadcast ! ( nodes[ 1 ] . node, nodes[ 0 ] . node. get_our_node_id( ) ) ;
5045
- nodes[ 0 ] . node . handle_closing_signed ( & nodes[ 1 ] . node . get_our_node_id ( ) , & node_1_closing_signed. unwrap ( ) ) . unwrap ( ) ;
5046
- let ( _, node_0_none) = get_closing_signed_broadcast ! ( nodes[ 0 ] . node, nodes[ 1 ] . node. get_our_node_id( ) ) ;
5047
- assert ! ( node_0_none. is_none( ) ) ;
5048
- }
5049
-
5050
5004
fn do_test_shutdown_rebroadcast ( recv_count : u8 ) {
5051
5005
// Test that shutdown/closing_signed is re-sent on reconnect with a variable number of
5052
5006
// messages delivered prior to disconnect
0 commit comments