@@ -324,7 +324,6 @@ fn do_test_monitor_temporary_update_fail(disconnect_count: usize) {
324
324
nodes[ 0 ] . node . handle_commitment_signed ( & nodes[ 1 ] . node . get_our_node_id ( ) , commitment_signed) ;
325
325
check_added_monitors ! ( nodes[ 0 ] , 1 ) ;
326
326
assert ! ( nodes[ 0 ] . node. get_and_clear_pending_msg_events( ) . is_empty( ) ) ;
327
- nodes[ 0 ] . logger . assert_log ( "lightning::ln::channelmanager" . to_string ( ) , "Previous monitor update failure prevented generation of RAA" . to_string ( ) , 1 ) ;
328
327
}
329
328
330
329
( update_fulfill_htlcs[ 0 ] . clone ( ) , commitment_signed. clone ( ) )
@@ -633,7 +632,6 @@ fn test_monitor_update_fail_cs() {
633
632
chanmon_cfgs[ 1 ] . persister . set_update_ret ( ChannelMonitorUpdateStatus :: InProgress ) ;
634
633
nodes[ 1 ] . node . handle_commitment_signed ( & nodes[ 0 ] . node . get_our_node_id ( ) , & send_event. commitment_msg ) ;
635
634
assert ! ( nodes[ 1 ] . node. get_and_clear_pending_msg_events( ) . is_empty( ) ) ;
636
- nodes[ 1 ] . logger . assert_log ( "lightning::ln::channelmanager" . to_string ( ) , "Failed to update ChannelMonitor" . to_string ( ) , 1 ) ;
637
635
check_added_monitors ! ( nodes[ 1 ] , 1 ) ;
638
636
assert ! ( nodes[ 1 ] . node. get_and_clear_pending_msg_events( ) . is_empty( ) ) ;
639
637
@@ -664,7 +662,6 @@ fn test_monitor_update_fail_cs() {
664
662
chanmon_cfgs[ 0 ] . persister . set_update_ret ( ChannelMonitorUpdateStatus :: InProgress ) ;
665
663
nodes[ 0 ] . node . handle_commitment_signed ( & nodes[ 1 ] . node . get_our_node_id ( ) , & updates. commitment_signed ) ;
666
664
assert ! ( nodes[ 0 ] . node. get_and_clear_pending_msg_events( ) . is_empty( ) ) ;
667
- nodes[ 0 ] . logger . assert_log ( "lightning::ln::channelmanager" . to_string ( ) , "Failed to update ChannelMonitor" . to_string ( ) , 1 ) ;
668
665
check_added_monitors ! ( nodes[ 0 ] , 1 ) ;
669
666
assert ! ( nodes[ 0 ] . node. get_and_clear_pending_msg_events( ) . is_empty( ) ) ;
670
667
} ,
@@ -726,7 +723,6 @@ fn test_monitor_update_fail_no_rebroadcast() {
726
723
chanmon_cfgs[ 1 ] . persister . set_update_ret ( ChannelMonitorUpdateStatus :: InProgress ) ;
727
724
nodes[ 1 ] . node . handle_revoke_and_ack ( & nodes[ 0 ] . node . get_our_node_id ( ) , & bs_raa) ;
728
725
assert ! ( nodes[ 1 ] . node. get_and_clear_pending_msg_events( ) . is_empty( ) ) ;
729
- nodes[ 1 ] . logger . assert_log ( "lightning::ln::channelmanager" . to_string ( ) , "Failed to update ChannelMonitor" . to_string ( ) , 1 ) ;
730
726
assert ! ( nodes[ 1 ] . node. get_and_clear_pending_msg_events( ) . is_empty( ) ) ;
731
727
assert ! ( nodes[ 1 ] . node. get_and_clear_pending_events( ) . is_empty( ) ) ;
732
728
check_added_monitors ! ( nodes[ 1 ] , 1 ) ;
@@ -784,12 +780,11 @@ fn test_monitor_update_raa_while_paused() {
784
780
nodes[ 0 ] . node . handle_update_add_htlc ( & nodes[ 1 ] . node . get_our_node_id ( ) , & send_event_2. msgs [ 0 ] ) ;
785
781
nodes[ 0 ] . node . handle_commitment_signed ( & nodes[ 1 ] . node . get_our_node_id ( ) , & send_event_2. commitment_msg ) ;
786
782
assert ! ( nodes[ 0 ] . node. get_and_clear_pending_msg_events( ) . is_empty( ) ) ;
787
- nodes[ 0 ] . logger . assert_log ( "lightning::ln::channelmanager" . to_string ( ) , "Failed to update ChannelMonitor" . to_string ( ) , 1 ) ;
788
783
check_added_monitors ! ( nodes[ 0 ] , 1 ) ;
784
+ assert ! ( nodes[ 0 ] . node. get_and_clear_pending_msg_events( ) . is_empty( ) ) ;
789
785
790
786
nodes[ 0 ] . node . handle_revoke_and_ack ( & nodes[ 1 ] . node . get_our_node_id ( ) , & bs_raa) ;
791
787
assert ! ( nodes[ 0 ] . node. get_and_clear_pending_msg_events( ) . is_empty( ) ) ;
792
- nodes[ 0 ] . logger . assert_log ( "lightning::ln::channelmanager" . to_string ( ) , "Existing pending monitor update prevented responses to RAA" . to_string ( ) , 1 ) ;
793
788
check_added_monitors ! ( nodes[ 0 ] , 1 ) ;
794
789
795
790
chanmon_cfgs[ 0 ] . persister . set_update_ret ( ChannelMonitorUpdateStatus :: Completed ) ;
@@ -875,7 +870,6 @@ fn do_test_monitor_update_fail_raa(test_ignore_second_cs: bool) {
875
870
chanmon_cfgs[ 1 ] . persister . set_update_ret ( ChannelMonitorUpdateStatus :: InProgress ) ;
876
871
nodes[ 1 ] . node . handle_revoke_and_ack ( & nodes[ 2 ] . node . get_our_node_id ( ) , & bs_revoke_and_ack) ;
877
872
assert ! ( nodes[ 1 ] . node. get_and_clear_pending_msg_events( ) . is_empty( ) ) ;
878
- nodes[ 1 ] . logger . assert_log ( "lightning::ln::channelmanager" . to_string ( ) , "Failed to update ChannelMonitor" . to_string ( ) , 1 ) ;
879
873
assert ! ( nodes[ 1 ] . node. get_and_clear_pending_events( ) . is_empty( ) ) ;
880
874
assert ! ( nodes[ 1 ] . node. get_and_clear_pending_msg_events( ) . is_empty( ) ) ;
881
875
check_added_monitors ! ( nodes[ 1 ] , 1 ) ;
@@ -911,8 +905,6 @@ fn do_test_monitor_update_fail_raa(test_ignore_second_cs: bool) {
911
905
nodes[ 1 ] . node . handle_commitment_signed ( & nodes[ 2 ] . node . get_our_node_id ( ) , & send_event. commitment_msg ) ;
912
906
check_added_monitors ! ( nodes[ 1 ] , 1 ) ;
913
907
assert ! ( nodes[ 1 ] . node. get_and_clear_pending_msg_events( ) . is_empty( ) ) ;
914
- nodes[ 1 ] . logger . assert_log ( "lightning::ln::channelmanager" . to_string ( ) , "Previous monitor update failure prevented generation of RAA" . to_string ( ) , 1 ) ;
915
- assert ! ( nodes[ 1 ] . node. get_and_clear_pending_msg_events( ) . is_empty( ) ) ;
916
908
( Some ( payment_preimage_4) , Some ( payment_hash_4) )
917
909
} else { ( None , None ) } ;
918
910
@@ -1136,7 +1128,7 @@ fn test_monitor_update_fail_reestablish() {
1136
1128
get_event_msg!( nodes[ 0 ] , MessageSendEvent :: SendChannelUpdate , nodes[ 1 ] . node. get_our_node_id( ) )
1137
1129
. contents. flags & 2 , 0 ) ; // The "disabled" bit should be unset as we just reconnected
1138
1130
1139
- nodes[ 1 ] . logger . assert_log ( "lightning::ln::channelmanager" . to_string ( ) , "Failed to update ChannelMonitor" . to_string ( ) , 1 ) ;
1131
+ nodes[ 1 ] . node . get_and_clear_pending_msg_events ( ) ; // Free the holding cell
1140
1132
check_added_monitors ! ( nodes[ 1 ] , 1 ) ;
1141
1133
1142
1134
nodes[ 1 ] . node . peer_disconnected ( & nodes[ 0 ] . node . get_our_node_id ( ) , false ) ;
@@ -1228,12 +1220,11 @@ fn raa_no_response_awaiting_raa_state() {
1228
1220
nodes[ 1 ] . node . handle_update_add_htlc ( & nodes[ 0 ] . node . get_our_node_id ( ) , & payment_event. msgs [ 0 ] ) ;
1229
1221
nodes[ 1 ] . node . handle_commitment_signed ( & nodes[ 0 ] . node . get_our_node_id ( ) , & payment_event. commitment_msg ) ;
1230
1222
assert ! ( nodes[ 1 ] . node. get_and_clear_pending_msg_events( ) . is_empty( ) ) ;
1231
- nodes[ 1 ] . logger . assert_log ( "lightning::ln::channelmanager" . to_string ( ) , "Failed to update ChannelMonitor" . to_string ( ) , 1 ) ;
1232
1223
check_added_monitors ! ( nodes[ 1 ] , 1 ) ;
1224
+ assert ! ( nodes[ 1 ] . node. get_and_clear_pending_msg_events( ) . is_empty( ) ) ;
1233
1225
1234
1226
nodes[ 1 ] . node . handle_revoke_and_ack ( & nodes[ 0 ] . node . get_our_node_id ( ) , & as_raa) ;
1235
1227
assert ! ( nodes[ 1 ] . node. get_and_clear_pending_msg_events( ) . is_empty( ) ) ;
1236
- nodes[ 1 ] . logger . assert_log ( "lightning::ln::channelmanager" . to_string ( ) , "Existing pending monitor update prevented responses to RAA" . to_string ( ) , 1 ) ;
1237
1228
check_added_monitors ! ( nodes[ 1 ] , 1 ) ;
1238
1229
1239
1230
chanmon_cfgs[ 1 ] . persister . set_update_ret ( ChannelMonitorUpdateStatus :: Completed ) ;
@@ -1331,7 +1322,6 @@ fn claim_while_disconnected_monitor_update_fail() {
1331
1322
1332
1323
nodes[ 1 ] . node . handle_channel_reestablish ( & nodes[ 0 ] . node . get_our_node_id ( ) , & as_reconnect) ;
1333
1324
let _bs_channel_update = get_event_msg ! ( nodes[ 1 ] , MessageSendEvent :: SendChannelUpdate , nodes[ 0 ] . node. get_our_node_id( ) ) ;
1334
- nodes[ 1 ] . logger . assert_log ( "lightning::ln::channelmanager" . to_string ( ) , "Failed to update ChannelMonitor" . to_string ( ) , 1 ) ;
1335
1325
check_added_monitors ! ( nodes[ 1 ] , 1 ) ;
1336
1326
assert ! ( nodes[ 1 ] . node. get_and_clear_pending_msg_events( ) . is_empty( ) ) ;
1337
1327
@@ -1348,7 +1338,6 @@ fn claim_while_disconnected_monitor_update_fail() {
1348
1338
nodes[ 1 ] . node . handle_commitment_signed ( & nodes[ 0 ] . node . get_our_node_id ( ) , & as_updates. commitment_signed ) ;
1349
1339
check_added_monitors ! ( nodes[ 1 ] , 1 ) ;
1350
1340
assert ! ( nodes[ 1 ] . node. get_and_clear_pending_msg_events( ) . is_empty( ) ) ;
1351
- nodes[ 1 ] . logger . assert_log ( "lightning::ln::channelmanager" . to_string ( ) , "Previous monitor update failure prevented generation of RAA" . to_string ( ) , 1 ) ;
1352
1341
// Note that nodes[1] not updating monitor here is OK - it wont take action on the new HTLC
1353
1342
// until we've channel_monitor_update'd and updated for the new commitment transaction.
1354
1343
@@ -1440,7 +1429,6 @@ fn monitor_failed_no_reestablish_response() {
1440
1429
nodes[ 1 ] . node . handle_update_add_htlc ( & nodes[ 0 ] . node . get_our_node_id ( ) , & payment_event. msgs [ 0 ] ) ;
1441
1430
nodes[ 1 ] . node . handle_commitment_signed ( & nodes[ 0 ] . node . get_our_node_id ( ) , & payment_event. commitment_msg ) ;
1442
1431
assert ! ( nodes[ 1 ] . node. get_and_clear_pending_msg_events( ) . is_empty( ) ) ;
1443
- nodes[ 1 ] . logger . assert_log ( "lightning::ln::channelmanager" . to_string ( ) , "Failed to update ChannelMonitor" . to_string ( ) , 1 ) ;
1444
1432
check_added_monitors ! ( nodes[ 1 ] , 1 ) ;
1445
1433
1446
1434
// Now disconnect and immediately reconnect, delivering the channel_reestablish while nodes[1]
@@ -1540,7 +1528,6 @@ fn first_message_on_recv_ordering() {
1540
1528
// to the next message also tests resetting the delivery order.
1541
1529
nodes[ 1 ] . node . handle_revoke_and_ack ( & nodes[ 0 ] . node . get_our_node_id ( ) , & as_raa) ;
1542
1530
assert ! ( nodes[ 1 ] . node. get_and_clear_pending_msg_events( ) . is_empty( ) ) ;
1543
- nodes[ 1 ] . logger . assert_log ( "lightning::ln::channelmanager" . to_string ( ) , "Failed to update ChannelMonitor" . to_string ( ) , 1 ) ;
1544
1531
check_added_monitors ! ( nodes[ 1 ] , 1 ) ;
1545
1532
1546
1533
// Now deliver the update_add_htlc/commitment_signed for the second payment, which does need an
@@ -1550,7 +1537,6 @@ fn first_message_on_recv_ordering() {
1550
1537
nodes[ 1 ] . node . handle_commitment_signed ( & nodes[ 0 ] . node . get_our_node_id ( ) , & payment_event. commitment_msg ) ;
1551
1538
check_added_monitors ! ( nodes[ 1 ] , 1 ) ;
1552
1539
assert ! ( nodes[ 1 ] . node. get_and_clear_pending_msg_events( ) . is_empty( ) ) ;
1553
- nodes[ 1 ] . logger . assert_log ( "lightning::ln::channelmanager" . to_string ( ) , "Previous monitor update failure prevented generation of RAA" . to_string ( ) , 1 ) ;
1554
1540
1555
1541
chanmon_cfgs[ 1 ] . persister . set_update_ret ( ChannelMonitorUpdateStatus :: Completed ) ;
1556
1542
let ( outpoint, latest_update, _) = nodes[ 1 ] . chain_monitor . latest_monitor_update_id . lock ( ) . unwrap ( ) . get ( & channel_id) . unwrap ( ) . clone ( ) ;
@@ -1599,7 +1585,7 @@ fn test_monitor_update_fail_claim() {
1599
1585
chanmon_cfgs[ 1 ] . persister . set_update_ret ( ChannelMonitorUpdateStatus :: InProgress ) ;
1600
1586
nodes[ 1 ] . node . claim_funds ( payment_preimage_1) ;
1601
1587
expect_payment_claimed ! ( nodes[ 1 ] , payment_hash_1, 1_000_000 ) ;
1602
- nodes[ 1 ] . logger . assert_log ( "lightning::ln::channelmanager" . to_string ( ) , "Temporary failure claiming HTLC, treating as success: Failed to update ChannelMonitor" . to_string ( ) , 1 ) ;
1588
+ assert ! ( nodes[ 1 ] . node . get_and_clear_pending_msg_events ( ) . is_empty ( ) ) ;
1603
1589
check_added_monitors ! ( nodes[ 1 ] , 1 ) ;
1604
1590
1605
1591
// Note that at this point there is a pending commitment transaction update for A being held by
@@ -1730,7 +1716,6 @@ fn test_monitor_update_on_pending_forwards() {
1730
1716
expect_pending_htlcs_forwardable_and_htlc_handling_failed ! ( nodes[ 1 ] , vec![ HTLCDestination :: NextHopChannel { node_id: Some ( nodes[ 2 ] . node. get_our_node_id( ) ) , channel_id: chan_2. 2 } ] ) ;
1731
1717
check_added_monitors ! ( nodes[ 1 ] , 1 ) ;
1732
1718
assert ! ( nodes[ 1 ] . node. get_and_clear_pending_msg_events( ) . is_empty( ) ) ;
1733
- nodes[ 1 ] . logger . assert_log ( "lightning::ln::channelmanager" . to_string ( ) , "Failed to update ChannelMonitor" . to_string ( ) , 1 ) ;
1734
1719
1735
1720
chanmon_cfgs[ 1 ] . persister . set_update_ret ( ChannelMonitorUpdateStatus :: Completed ) ;
1736
1721
let ( outpoint, latest_update, _) = nodes[ 1 ] . chain_monitor . latest_monitor_update_id . lock ( ) . unwrap ( ) . get ( & chan_1. 2 ) . unwrap ( ) . clone ( ) ;
@@ -1791,9 +1776,7 @@ fn monitor_update_claim_fail_no_response() {
1791
1776
expect_payment_claimed ! ( nodes[ 1 ] , payment_hash_1, 1_000_000 ) ;
1792
1777
check_added_monitors ! ( nodes[ 1 ] , 1 ) ;
1793
1778
1794
- let events = nodes[ 1 ] . node . get_and_clear_pending_msg_events ( ) ;
1795
- assert_eq ! ( events. len( ) , 0 ) ;
1796
- nodes[ 1 ] . logger . assert_log ( "lightning::ln::channelmanager" . to_string ( ) , "Temporary failure claiming HTLC, treating as success: Failed to update ChannelMonitor" . to_string ( ) , 1 ) ;
1779
+ assert ! ( nodes[ 1 ] . node. get_and_clear_pending_msg_events( ) . is_empty( ) ) ;
1797
1780
1798
1781
chanmon_cfgs[ 1 ] . persister . set_update_ret ( ChannelMonitorUpdateStatus :: Completed ) ;
1799
1782
let ( outpoint, latest_update, _) = nodes[ 1 ] . chain_monitor . latest_monitor_update_id . lock ( ) . unwrap ( ) . get ( & channel_id) . unwrap ( ) . clone ( ) ;
@@ -1841,9 +1824,8 @@ fn do_during_funding_monitor_fail(confirm_a_first: bool, restore_b_before_conf:
1841
1824
1842
1825
chanmon_cfgs[ 0 ] . persister . set_update_ret ( ChannelMonitorUpdateStatus :: InProgress ) ;
1843
1826
nodes[ 0 ] . node . handle_funding_signed ( & nodes[ 1 ] . node . get_our_node_id ( ) , & get_event_msg ! ( nodes[ 1 ] , MessageSendEvent :: SendFundingSigned , nodes[ 0 ] . node. get_our_node_id( ) ) ) ;
1844
- assert ! ( nodes[ 0 ] . node. get_and_clear_pending_msg_events( ) . is_empty( ) ) ;
1845
- nodes[ 0 ] . logger . assert_log ( "lightning::ln::channelmanager" . to_string ( ) , "Failed to update ChannelMonitor" . to_string ( ) , 1 ) ;
1846
1827
check_added_monitors ! ( nodes[ 0 ] , 1 ) ;
1828
+ assert ! ( nodes[ 0 ] . node. get_and_clear_pending_msg_events( ) . is_empty( ) ) ;
1847
1829
assert ! ( nodes[ 0 ] . node. get_and_clear_pending_events( ) . is_empty( ) ) ;
1848
1830
chanmon_cfgs[ 0 ] . persister . set_update_ret ( ChannelMonitorUpdateStatus :: Completed ) ;
1849
1831
let ( outpoint, latest_update, _) = nodes[ 0 ] . chain_monitor . latest_monitor_update_id . lock ( ) . unwrap ( ) . get ( & channel_id) . unwrap ( ) . clone ( ) ;
0 commit comments