@@ -93,6 +93,7 @@ fn test_monitor_and_persister_update_fail() {
93
93
let updates = get_htlc_update_msgs ! ( nodes[ 1 ] , nodes[ 0 ] . node. get_our_node_id( ) ) ;
94
94
assert_eq ! ( updates. update_fulfill_htlcs. len( ) , 1 ) ;
95
95
nodes[ 0 ] . node . handle_update_fulfill_htlc ( & nodes[ 1 ] . node . get_our_node_id ( ) , & updates. update_fulfill_htlcs [ 0 ] ) ;
96
+
96
97
{
97
98
let mut node_0_per_peer_lock;
98
99
let mut node_0_peer_state_lock;
@@ -102,15 +103,19 @@ fn test_monitor_and_persister_update_fail() {
102
103
// as the monitor update errors.
103
104
if let ChannelMonitorUpdateStatus :: InProgress = chain_mon. chain_monitor . update_channel ( outpoint, & update) { } else { panic ! ( "Expected monitor paused" ) ; }
104
105
logger. assert_log_regex ( "lightning::chain::chainmonitor" , regex:: Regex :: new ( "Failed to update ChannelMonitor for channel [0-9a-f]*." ) . unwrap ( ) , 1 ) ;
106
+
107
+ // Apply the montior update to the original ChainMonitor, ensuring the
108
+ // ChannelManager and ChannelMonitor aren't out of sync.
109
+ assert_eq ! ( nodes[ 0 ] . chain_monitor. update_channel( outpoint, & update) ,
110
+ ChannelMonitorUpdateStatus :: Completed ) ;
105
111
} else { assert ! ( false ) ; }
106
112
} else {
107
113
assert ! ( false ) ;
108
114
}
109
115
}
110
116
111
117
check_added_monitors ! ( nodes[ 0 ] , 1 ) ;
112
- let events = nodes[ 0 ] . node . get_and_clear_pending_events ( ) ;
113
- assert_eq ! ( events. len( ) , 1 ) ;
118
+ expect_payment_sent ( & nodes[ 0 ] , preimage, None , false , false ) ;
114
119
}
115
120
116
121
fn do_test_simple_monitor_temporary_update_fail ( disconnect : bool ) {
0 commit comments