+ ));
+
+ // Exit if either CLI polling exits or the background processor exits (which shouldn't happen
+ // unless we fail to write to the filesystem).
+ tokio::select! {
+ _ = cli_poll => {},
+ bg_res = &mut background_processor => {
+ stop_listen_connect.store(true, Ordering::Release);
+ peer_manager.disconnect_all_peers();
+ panic!("ERR: background processing stopped with result {:?}, exiting", bg_res);
+ },
+ }