X-Git-Url: http://git.bitcoin.ninja/index.cgi?a=blobdiff_plain;f=lightning-c-bindings%2Fsrc%2Flightning_background_processor.rs;h=0bd445298b0e5c89383ccb29a508d13545031f9e;hb=b2819774e287d465e23415cbfdaa397e2e0a2749;hp=c35788f72b72c1fdec5f0a4ac631812409ec877f;hpb=18337a0191c3abdca8d51861c328dd3d2d9ca6b7;p=ldk-c-bindings diff --git a/lightning-c-bindings/src/lightning_background_processor.rs b/lightning-c-bindings/src/lightning_background_processor.rs index c35788f..0bd4452 100644 --- a/lightning-c-bindings/src/lightning_background_processor.rs +++ b/lightning-c-bindings/src/lightning_background_processor.rs @@ -10,11 +10,13 @@ //! running properly, and (2) either can or should be run in the background. See docs for //! [`BackgroundProcessor`] for more details on the nitty-gritty. -use std::str::FromStr; -use std::ffi::c_void; +use alloc::str::FromStr; +use core::ffi::c_void; use core::convert::Infallible; use bitcoin::hashes::Hash; use crate::c_types::*; +#[cfg(feature="no-std")] +use alloc::{vec::Vec, boxed::Box}; use lightning_background_processor::BackgroundProcessor as nativeBackgroundProcessorImport; @@ -29,6 +31,8 @@ pub(crate) type nativeBackgroundProcessor = nativeBackgroundProcessorImport; /// [`ChannelManager`] persistence should be done in the background. /// * Calling [`ChannelManager::timer_tick_occurred`] and [`PeerManager::timer_tick_occurred`] /// at the appropriate intervals. +/// * Calling [`NetworkGraph::remove_stale_channels`] (if a [`NetGraphMsgHandler`] is provided to +/// [`BackgroundProcessor::start`]). /// /// It will also call [`PeerManager::process_events`] periodically though this shouldn't be relied /// upon as doing so may result in high latency. @@ -85,7 +89,7 @@ impl BackgroundProcessor { pub(crate) fn take_inner(mut self) -> *mut nativeBackgroundProcessor { assert!(self.is_owned); let ret = ObjOps::untweak_ptr(self.inner); - self.inner = std::ptr::null_mut(); + self.inner = core::ptr::null_mut(); ret } } @@ -129,7 +133,7 @@ impl rustChannelManagerPersister &Self { self @@ -170,7 +174,7 @@ impl Drop for ChannelManagerPersister { /// functionality implemented by other handlers. /// * [`NetGraphMsgHandler`] if given will update the [`NetworkGraph`] based on payment failures. /// -/// [top-level documentation]: Self +/// [top-level documentation]: BackgroundProcessor /// [`join`]: Self::join /// [`stop`]: Self::stop /// [`ChannelManager`]: lightning::ln::channelmanager::ChannelManager