RapidGossipSync and ProbabilisticScorer instances are created just to be fed to the background processor. Properly initializing them will be handled in later PRs.
The docs state that a persistence error will make the background processor stop and that this should be handled by calling
join(), handling the error, and finally starting the background processor again.
To deal with that, instead of just having the initial thread launching the thread in which the background processor runs, we have a new intermediate thread that continually launches the background processor, joins, launches again, and so forth.
The main issue I'm experiencing is that now there's no easy way for the original thread to stop the background processor gracefully. For that to be possible, the new thread must not block on the
join(). That would be possible if the
JoinHandle field of
lightning_background_processor::BackgroundProcessor was public. That way, the new thread could call
JoinHandle.is_finished() and avoid getting stuck in