Skip to content

Commit 384c4dc

Browse files
authored
Merge pull request #1843 from TheBlueMatt/2022-11-fix-bp-exit-docs
Correct async `lightning-background-processor` exit check docs
2 parents b6fce3d + 71739db commit 384c4dc

File tree

1 file changed

+6
-6
lines changed
  • lightning-background-processor/src

1 file changed

+6
-6
lines changed

lightning-background-processor/src/lib.rs

+6-6
Original file line numberDiff line numberDiff line change
@@ -358,8 +358,8 @@ macro_rules! define_run_body {
358358
/// Processes background events in a future.
359359
///
360360
/// `sleeper` should return a future which completes in the given amount of time and returns a
361-
/// boolean indicating whether the background processing should continue. Once `sleeper` returns a
362-
/// future which outputs false, the loop will exit and this function's future will complete.
361+
/// boolean indicating whether the background processing should exit. Once `sleeper` returns a
362+
/// future which outputs true, the loop will exit and this function's future will complete.
363363
///
364364
/// See [`BackgroundProcessor::start`] for information on which actions this handles.
365365
#[cfg(feature = "futures")]
@@ -411,13 +411,13 @@ where
411411
UMH::Target: 'static + CustomMessageHandler,
412412
PS::Target: 'static + Persister<'a, Signer, CW, T, K, F, L, SC>,
413413
{
414-
let mut should_continue = true;
414+
let mut should_break = true;
415415
define_run_body!(persister, event_handler, chain_monitor, channel_manager,
416-
gossip_sync, peer_manager, logger, scorer, should_continue, {
416+
gossip_sync, peer_manager, logger, scorer, should_break, {
417417
select_biased! {
418418
_ = channel_manager.get_persistable_update_future().fuse() => true,
419-
cont = sleeper(Duration::from_millis(100)).fuse() => {
420-
should_continue = cont;
419+
exit = sleeper(Duration::from_millis(100)).fuse() => {
420+
should_break = exit;
421421
false
422422
}
423423
}

0 commit comments

Comments
 (0)