Skip to content

Commit c6bbb99

Browse files
committed
f more comment on how we test
1 parent f428943 commit c6bbb99

File tree

1 file changed

+4
-0
lines changed

1 file changed

+4
-0
lines changed

Diff for: lightning/src/ln/chanmon_update_fail_tests.rs

+4
Original file line numberDiff line numberDiff line change
@@ -3903,6 +3903,10 @@ fn test_single_channel_multiple_mpp() {
39033903
*nodes[6].chain_monitor.write_blocker.lock().unwrap() = Some(blocker);
39043904

39053905
// Until we have std::thread::scoped we have to unsafe { turn off the borrow checker }.
3906+
// We do this by casting a pointer to a `TestChannelManager` to a pointer to a
3907+
// `TestChannelManager` with different (in this case 'static) lifetime.
3908+
// This is even suggested in the second example at
3909+
// https://doc.rust-lang.org/std/mem/fn.transmute.html#examples
39063910
let claim_node: &'static TestChannelManager<'static, 'static> =
39073911
unsafe { std::mem::transmute(nodes[6].node as &TestChannelManager) };
39083912
let thrd = std::thread::spawn(move || {

0 commit comments

Comments
 (0)