File tree Expand file tree Collapse file tree 1 file changed +1
-25
lines changed
lightning-background-processor/src Expand file tree Collapse file tree 1 file changed +1
-25
lines changed Original file line number Diff line number Diff line change @@ -624,30 +624,6 @@ mod tests {
624624 }
625625 }
626626
627- macro_rules! check_mutex_persisted_data {
628- ( $node: expr, $filepath: expr) => {
629- let mut expected_bytes = Vec :: new( ) ;
630- loop {
631- expected_bytes. clear( ) ;
632- match $node. lock( ) . unwrap( ) . write( & mut expected_bytes) {
633- Ok ( _) => {
634- match std:: fs:: read( $filepath) {
635- Ok ( bytes) => {
636- if bytes == expected_bytes {
637- break
638- } else {
639- continue
640- }
641- } ,
642- Err ( _) => continue
643- }
644- } ,
645- Err ( e) => panic!( "Unexpected error: {}" , e)
646- }
647- }
648- }
649- }
650-
651627 // Check that the initial channel manager data is persisted as expected.
652628 let filepath = get_full_filepath ( "test_background_processor_persister_0" . to_string ( ) , "manager" . to_string ( ) ) ;
653629 check_persisted_data ! ( nodes[ 0 ] . node, filepath. clone( ) ) ;
@@ -674,7 +650,7 @@ mod tests {
674650
675651 // Check scorer is persisted
676652 let filepath = get_full_filepath ( "test_background_processor_persister_0" . to_string ( ) , "scorer" . to_string ( ) ) ;
677- check_mutex_persisted_data ! ( scorer, filepath. clone( ) ) ;
653+ check_persisted_data ! ( scorer. lock ( ) . unwrap ( ) , filepath. clone( ) ) ;
678654
679655 assert ! ( bg_processor. stop( ) . is_ok( ) ) ;
680656 }
You can’t perform that action at this time.
0 commit comments