Skip to content

Commit 52cb1b8

Browse files
committed
Remove check_mutex_persisted_data
1 parent 8e3f22a commit 52cb1b8

File tree

1 file changed

+1
-25
lines changed
  • lightning-background-processor/src

1 file changed

+1
-25
lines changed

lightning-background-processor/src/lib.rs

+1-25
Original file line numberDiff line numberDiff 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
}

0 commit comments

Comments
 (0)