@@ -55,7 +55,7 @@ use lightning::sign::EntropySource;
55
55
use lightning:: sign:: OutputSpender ;
56
56
use lightning:: util:: logger:: Logger ;
57
57
use lightning:: util:: persist:: {
58
- KVStore , CHANNEL_MANAGER_PERSISTENCE_KEY , CHANNEL_MANAGER_PERSISTENCE_PRIMARY_NAMESPACE ,
58
+ KVStoreSync , CHANNEL_MANAGER_PERSISTENCE_KEY , CHANNEL_MANAGER_PERSISTENCE_PRIMARY_NAMESPACE ,
59
59
CHANNEL_MANAGER_PERSISTENCE_SECONDARY_NAMESPACE , NETWORK_GRAPH_PERSISTENCE_KEY ,
60
60
NETWORK_GRAPH_PERSISTENCE_PRIMARY_NAMESPACE , NETWORK_GRAPH_PERSISTENCE_SECONDARY_NAMESPACE ,
61
61
SCORER_PERSISTENCE_KEY , SCORER_PERSISTENCE_PRIMARY_NAMESPACE ,
@@ -729,8 +729,8 @@ use futures_util::{dummy_waker, OptionalSelector, Selector, SelectorOutput};
729
729
/// # impl lightning::util::logger::Logger for Logger {
730
730
/// # fn log(&self, _record: lightning::util::logger::Record) {}
731
731
/// # }
732
- /// # struct Store {}
733
- /// # impl lightning::util::persist::KVStore for Store {
732
+ /// # struct StoreSync {}
733
+ /// # impl lightning::util::persist::KVStoreSync for StoreSync {
734
734
/// # fn read(&self, primary_namespace: &str, secondary_namespace: &str, key: &str) -> io::Result<Vec<u8>> { Ok(Vec::new()) }
735
735
/// # fn write(&self, primary_namespace: &str, secondary_namespace: &str, key: &str, buf: &[u8]) -> io::Result<()> { Ok(()) }
736
736
/// # fn remove(&self, primary_namespace: &str, secondary_namespace: &str, key: &str, lazy: bool) -> io::Result<()> { Ok(()) }
@@ -746,14 +746,14 @@ use futures_util::{dummy_waker, OptionalSelector, Selector, SelectorOutput};
746
746
/// # fn send_data(&mut self, _data: &[u8], _resume_read: bool) -> usize { 0 }
747
747
/// # fn disconnect_socket(&mut self) {}
748
748
/// # }
749
- /// # type ChainMonitor<B, F, FE> = lightning::chain::chainmonitor::ChainMonitor<lightning::sign::InMemorySigner, Arc<F>, Arc<B>, Arc<FE>, Arc<Logger>, Arc<Store >, Arc<lightning::sign::KeysManager>>;
749
+ /// # type ChainMonitor<B, F, FE> = lightning::chain::chainmonitor::ChainMonitor<lightning::sign::InMemorySigner, Arc<F>, Arc<B>, Arc<FE>, Arc<Logger>, Arc<StoreSync >, Arc<lightning::sign::KeysManager>>;
750
750
/// # type NetworkGraph = lightning::routing::gossip::NetworkGraph<Arc<Logger>>;
751
751
/// # type P2PGossipSync<UL> = lightning::routing::gossip::P2PGossipSync<Arc<NetworkGraph>, Arc<UL>, Arc<Logger>>;
752
752
/// # type ChannelManager<B, F, FE> = lightning::ln::channelmanager::SimpleArcChannelManager<ChainMonitor<B, F, FE>, B, FE, Logger>;
753
753
/// # type OnionMessenger<B, F, FE> = lightning::onion_message::messenger::OnionMessenger<Arc<lightning::sign::KeysManager>, Arc<lightning::sign::KeysManager>, Arc<Logger>, Arc<ChannelManager<B, F, FE>>, Arc<lightning::onion_message::messenger::DefaultMessageRouter<Arc<NetworkGraph>, Arc<Logger>, Arc<lightning::sign::KeysManager>>>, Arc<ChannelManager<B, F, FE>>, lightning::ln::peer_handler::IgnoringMessageHandler, lightning::ln::peer_handler::IgnoringMessageHandler, lightning::ln::peer_handler::IgnoringMessageHandler>;
754
754
/// # type LiquidityManager<B, F, FE> = lightning_liquidity::LiquidityManager<Arc<lightning::sign::KeysManager>, Arc<ChannelManager<B, F, FE>>, Arc<F>>;
755
755
/// # type Scorer = RwLock<lightning::routing::scoring::ProbabilisticScorer<Arc<NetworkGraph>, Arc<Logger>>>;
756
- /// # type PeerManager<B, F, FE, UL> = lightning::ln::peer_handler::SimpleArcPeerManager<SocketDescriptor, ChainMonitor<B, F, FE>, B, FE, Arc<UL>, Logger, F, Store >;
756
+ /// # type PeerManager<B, F, FE, UL> = lightning::ln::peer_handler::SimpleArcPeerManager<SocketDescriptor, ChainMonitor<B, F, FE>, B, FE, Arc<UL>, Logger, F, StoreSync >;
757
757
/// #
758
758
/// # struct Node<
759
759
/// # B: lightning::chain::chaininterface::BroadcasterInterface + Send + Sync + 'static,
@@ -770,10 +770,10 @@ use futures_util::{dummy_waker, OptionalSelector, Selector, SelectorOutput};
770
770
/// # liquidity_manager: Arc<LiquidityManager<B, F, FE>>,
771
771
/// # chain_monitor: Arc<ChainMonitor<B, F, FE>>,
772
772
/// # gossip_sync: Arc<P2PGossipSync<UL>>,
773
- /// # persister: Arc<Store >,
773
+ /// # persister: Arc<StoreSync >,
774
774
/// # logger: Arc<Logger>,
775
775
/// # scorer: Arc<Scorer>,
776
- /// # sweeper: Arc<OutputSweeper<Arc<B>, Arc<D>, Arc<FE>, Arc<F>, Arc<Store >, Arc<Logger>, Arc<O>>>,
776
+ /// # sweeper: Arc<OutputSweeper<Arc<B>, Arc<D>, Arc<FE>, Arc<F>, Arc<StoreSync >, Arc<Logger>, Arc<O>>>,
777
777
/// # }
778
778
/// #
779
779
/// # async fn setup_background_processing<
@@ -895,7 +895,7 @@ where
895
895
LM :: Target : ALiquidityManager ,
896
896
O :: Target : ' static + OutputSpender ,
897
897
D :: Target : ' static + ChangeDestinationSource ,
898
- K :: Target : ' static + KVStore ,
898
+ K :: Target : ' static + KVStoreSync ,
899
899
{
900
900
let mut should_break = false ;
901
901
let async_event_handler = |event| {
@@ -1016,21 +1016,21 @@ impl BackgroundProcessor {
1016
1016
/// documentation].
1017
1017
///
1018
1018
/// The thread runs indefinitely unless the object is dropped, [`stop`] is called, or
1019
- /// [`KVStore `] returns an error. In case of an error, the error is retrieved by calling
1019
+ /// [`KVStoreSync `] returns an error. In case of an error, the error is retrieved by calling
1020
1020
/// either [`join`] or [`stop`].
1021
1021
///
1022
1022
/// # Data Persistence
1023
1023
///
1024
- /// [`KVStore `] is responsible for writing out the [`ChannelManager`] to disk, and/or
1024
+ /// [`KVStoreSync `] is responsible for writing out the [`ChannelManager`] to disk, and/or
1025
1025
/// uploading to one or more backup services. See [`ChannelManager::write`] for writing out a
1026
1026
/// [`ChannelManager`]. See the `lightning-persister` crate for LDK's
1027
1027
/// provided implementation.
1028
1028
///
1029
- /// [`KVStore `] is also responsible for writing out the [`NetworkGraph`] to disk, if
1029
+ /// [`KVStoreSync `] is also responsible for writing out the [`NetworkGraph`] to disk, if
1030
1030
/// [`GossipSync`] is supplied. See [`NetworkGraph::write`] for writing out a [`NetworkGraph`].
1031
1031
/// See the `lightning-persister` crate for LDK's provided implementation.
1032
1032
///
1033
- /// Typically, users should either implement [`KVStore `] to never return an
1033
+ /// Typically, users should either implement [`KVStoreSync `] to never return an
1034
1034
/// error or call [`join`] and handle any error that may arise. For the latter case,
1035
1035
/// `BackgroundProcessor` must be restarted by calling `start` again after handling the error.
1036
1036
///
@@ -1102,7 +1102,7 @@ impl BackgroundProcessor {
1102
1102
LM :: Target : ALiquidityManager ,
1103
1103
D :: Target : ChangeDestinationSourceSync ,
1104
1104
O :: Target : ' static + OutputSpender ,
1105
- K :: Target : ' static + KVStore ,
1105
+ K :: Target : ' static + KVStoreSync ,
1106
1106
{
1107
1107
let stop_thread = Arc :: new ( AtomicBool :: new ( false ) ) ;
1108
1108
let stop_thread_clone = Arc :: clone ( & stop_thread) ;
@@ -1283,7 +1283,8 @@ mod tests {
1283
1283
use lightning:: types:: payment:: PaymentHash ;
1284
1284
use lightning:: util:: config:: UserConfig ;
1285
1285
use lightning:: util:: persist:: {
1286
- KVStore , CHANNEL_MANAGER_PERSISTENCE_KEY , CHANNEL_MANAGER_PERSISTENCE_PRIMARY_NAMESPACE ,
1286
+ KVStoreSync , CHANNEL_MANAGER_PERSISTENCE_KEY ,
1287
+ CHANNEL_MANAGER_PERSISTENCE_PRIMARY_NAMESPACE ,
1287
1288
CHANNEL_MANAGER_PERSISTENCE_SECONDARY_NAMESPACE , NETWORK_GRAPH_PERSISTENCE_KEY ,
1288
1289
NETWORK_GRAPH_PERSISTENCE_PRIMARY_NAMESPACE , NETWORK_GRAPH_PERSISTENCE_SECONDARY_NAMESPACE ,
1289
1290
SCORER_PERSISTENCE_KEY , SCORER_PERSISTENCE_PRIMARY_NAMESPACE ,
@@ -1522,7 +1523,7 @@ mod tests {
1522
1523
}
1523
1524
}
1524
1525
1525
- impl KVStore for Persister {
1526
+ impl KVStoreSync for Persister {
1526
1527
fn read (
1527
1528
& self , primary_namespace : & str , secondary_namespace : & str , key : & str ,
1528
1529
) -> lightning:: io:: Result < Vec < u8 > > {
0 commit comments