]> git.bitcoin.ninja Git - rust-lightning/commit
Avoid `poll`ing completed futures in the `background-processor` 2023-03-future-poll-panic
authorMatt Corallo <git@bluematt.me>
Tue, 7 Mar 2023 18:06:12 +0000 (18:06 +0000)
committerMatt Corallo <git@bluematt.me>
Tue, 7 Mar 2023 18:06:12 +0000 (18:06 +0000)
commit1751f77edf1de9b0bd3985eeb94155172c415ad1
treedf3373d8de7614044c7c31727432c4494e18d66d
parentaf76face12e924132596479f8b54849b14414f84
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.
lightning-background-processor/src/lib.rs