mirror of
https://github.com/lightningdevkit/rust-lightning.git
synced 2025-02-24 23:08:36 +01:00
Avoid poll
ing completed futures in the background-processor
`poll`ing completed futures invokes undefined behavior in Rust (panics, etc, obviously not memory corruption as its not unsafe). Sadly, in our futures-based version of `lightning-background-processor` we have one case where we can `poll` a completed future - if the timer for the network graph prune + persist completes without a network graph to prune + persist we'll happily poll the same future over and over again, likely panicing in user code.
This commit is contained in:
parent
af76face12
commit
1751f77edf
1 changed files with 1 additions and 1 deletions
|
@ -349,9 +349,9 @@ macro_rules! define_run_body {
|
|||
log_error!($logger, "Error: Failed to persist network graph, check your disk and permissions {}", e)
|
||||
}
|
||||
|
||||
last_prune_call = $get_timer(NETWORK_PRUNE_TIMER);
|
||||
have_pruned = true;
|
||||
}
|
||||
last_prune_call = $get_timer(NETWORK_PRUNE_TIMER);
|
||||
}
|
||||
|
||||
if $timer_elapsed(&mut last_scorer_persist_call, SCORER_PERSIST_TIMER) {
|
||||
|
|
Loading…
Add table
Reference in a new issue