Skip to content

Commit

Permalink
f Quick-fix test_threaded_payment_retries
Browse files Browse the repository at this point in the history
... as the closure behavior slightly changed from edition 2018: using
`node_ref.0` inside the closure won't result in `node_ref` being
captured.

However, as the comment there states, we really want to fix this by
using scoped threads which are available now.
  • Loading branch information
tnull committed Nov 1, 2023
1 parent bb564f6 commit 674465b
Showing 1 changed file with 1 addition and 0 deletions.
1 change: 1 addition & 0 deletions lightning/src/ln/payment_tests.rs
Original file line number Diff line number Diff line change
Expand Up @@ -3325,6 +3325,7 @@ fn test_threaded_payment_retries() {
// We really want std::thread::scope, but its not stable until 1.63. Until then, we get unsafe.
let node_ref = NodePtr::from_node(&nodes[0]);
move || {
let _ = &node_ref;
let node_a = unsafe { &*node_ref.0 };
while Instant::now() < end_time {
node_a.node.get_and_clear_pending_events(); // wipe the PendingHTLCsForwardable
Expand Down

0 comments on commit 674465b

Please sign in to comment.