@@ -42,7 +42,7 @@ use lightning::sign::EntropySource;
42
42
use lightning:: sign:: OutputSpender ;
43
43
use lightning:: util:: logger:: Logger ;
44
44
use lightning:: util:: persist:: {
45
- KVStore , CHANNEL_MANAGER_PERSISTENCE_KEY , CHANNEL_MANAGER_PERSISTENCE_PRIMARY_NAMESPACE ,
45
+ KVStoreSync , CHANNEL_MANAGER_PERSISTENCE_KEY , CHANNEL_MANAGER_PERSISTENCE_PRIMARY_NAMESPACE ,
46
46
CHANNEL_MANAGER_PERSISTENCE_SECONDARY_NAMESPACE , NETWORK_GRAPH_PERSISTENCE_KEY ,
47
47
NETWORK_GRAPH_PERSISTENCE_PRIMARY_NAMESPACE , NETWORK_GRAPH_PERSISTENCE_SECONDARY_NAMESPACE ,
48
48
SCORER_PERSISTENCE_KEY , SCORER_PERSISTENCE_PRIMARY_NAMESPACE ,
@@ -690,8 +690,8 @@ use futures_util::{dummy_waker, OptionalSelector, Selector, SelectorOutput};
690
690
/// # impl lightning::util::logger::Logger for Logger {
691
691
/// # fn log(&self, _record: lightning::util::logger::Record) {}
692
692
/// # }
693
- /// # struct Store {}
694
- /// # impl lightning::util::persist::KVStore for Store {
693
+ /// # struct StoreSync {}
694
+ /// # impl lightning::util::persist::KVStoreSync for StoreSync {
695
695
/// # fn read(&self, primary_namespace: &str, secondary_namespace: &str, key: &str) -> io::Result<Vec<u8>> { Ok(Vec::new()) }
696
696
/// # fn write(&self, primary_namespace: &str, secondary_namespace: &str, key: &str, buf: &[u8]) -> io::Result<()> { Ok(()) }
697
697
/// # fn remove(&self, primary_namespace: &str, secondary_namespace: &str, key: &str, lazy: bool) -> io::Result<()> { Ok(()) }
@@ -707,14 +707,14 @@ use futures_util::{dummy_waker, OptionalSelector, Selector, SelectorOutput};
707
707
/// # fn send_data(&mut self, _data: &[u8], _resume_read: bool) -> usize { 0 }
708
708
/// # fn disconnect_socket(&mut self) {}
709
709
/// # }
710
- /// # 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>>;
710
+ /// # 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>>;
711
711
/// # type NetworkGraph = lightning::routing::gossip::NetworkGraph<Arc<Logger>>;
712
712
/// # type P2PGossipSync<UL> = lightning::routing::gossip::P2PGossipSync<Arc<NetworkGraph>, Arc<UL>, Arc<Logger>>;
713
713
/// # type ChannelManager<B, F, FE> = lightning::ln::channelmanager::SimpleArcChannelManager<ChainMonitor<B, F, FE>, B, FE, Logger>;
714
714
/// # 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>;
715
715
/// # type LiquidityManager<B, F, FE> = lightning_liquidity::LiquidityManager<Arc<lightning::sign::KeysManager>, Arc<ChannelManager<B, F, FE>>, Arc<F>>;
716
716
/// # type Scorer = RwLock<lightning::routing::scoring::ProbabilisticScorer<Arc<NetworkGraph>, Arc<Logger>>>;
717
- /// # type PeerManager<B, F, FE, UL> = lightning::ln::peer_handler::SimpleArcPeerManager<SocketDescriptor, ChainMonitor<B, F, FE>, B, FE, Arc<UL>, Logger, F, Store >;
717
+ /// # type PeerManager<B, F, FE, UL> = lightning::ln::peer_handler::SimpleArcPeerManager<SocketDescriptor, ChainMonitor<B, F, FE>, B, FE, Arc<UL>, Logger, F, StoreSync >;
718
718
/// #
719
719
/// # struct Node<
720
720
/// # B: lightning::chain::chaininterface::BroadcasterInterface + Send + Sync + 'static,
@@ -731,10 +731,10 @@ use futures_util::{dummy_waker, OptionalSelector, Selector, SelectorOutput};
731
731
/// # liquidity_manager: Arc<LiquidityManager<B, F, FE>>,
732
732
/// # chain_monitor: Arc<ChainMonitor<B, F, FE>>,
733
733
/// # gossip_sync: Arc<P2PGossipSync<UL>>,
734
- /// # persister: Arc<Store >,
734
+ /// # persister: Arc<StoreSync >,
735
735
/// # logger: Arc<Logger>,
736
736
/// # scorer: Arc<Scorer>,
737
- /// # sweeper: Arc<OutputSweeper<Arc<B>, Arc<D>, Arc<FE>, Arc<F>, Arc<Store >, Arc<Logger>, Arc<O>>>,
737
+ /// # sweeper: Arc<OutputSweeper<Arc<B>, Arc<D>, Arc<FE>, Arc<F>, Arc<StoreSync >, Arc<Logger>, Arc<O>>>,
738
738
/// # }
739
739
/// #
740
740
/// # async fn setup_background_processing<
@@ -856,7 +856,7 @@ where
856
856
LM :: Target : ALiquidityManager ,
857
857
O :: Target : ' static + OutputSpender ,
858
858
D :: Target : ' static + ChangeDestinationSource ,
859
- K :: Target : ' static + KVStore ,
859
+ K :: Target : ' static + KVStoreSync ,
860
860
{
861
861
let mut should_break = false ;
862
862
let async_event_handler = |event| {
@@ -967,21 +967,21 @@ impl BackgroundProcessor {
967
967
/// documentation].
968
968
///
969
969
/// The thread runs indefinitely unless the object is dropped, [`stop`] is called, or
970
- /// [`KVStore `] returns an error. In case of an error, the error is retrieved by calling
970
+ /// [`KVStoreSync `] returns an error. In case of an error, the error is retrieved by calling
971
971
/// either [`join`] or [`stop`].
972
972
///
973
973
/// # Data Persistence
974
974
///
975
- /// [`KVStore `] is responsible for writing out the [`ChannelManager`] to disk, and/or
975
+ /// [`KVStoreSync `] is responsible for writing out the [`ChannelManager`] to disk, and/or
976
976
/// uploading to one or more backup services. See [`ChannelManager::write`] for writing out a
977
977
/// [`ChannelManager`]. See the `lightning-persister` crate for LDK's
978
978
/// provided implementation.
979
979
///
980
- /// [`KVStore `] is also responsible for writing out the [`NetworkGraph`] to disk, if
980
+ /// [`KVStoreSync `] is also responsible for writing out the [`NetworkGraph`] to disk, if
981
981
/// [`GossipSync`] is supplied. See [`NetworkGraph::write`] for writing out a [`NetworkGraph`].
982
982
/// See the `lightning-persister` crate for LDK's provided implementation.
983
983
///
984
- /// Typically, users should either implement [`KVStore `] to never return an
984
+ /// Typically, users should either implement [`KVStoreSync `] to never return an
985
985
/// error or call [`join`] and handle any error that may arise. For the latter case,
986
986
/// `BackgroundProcessor` must be restarted by calling `start` again after handling the error.
987
987
///
@@ -1053,7 +1053,7 @@ impl BackgroundProcessor {
1053
1053
LM :: Target : ALiquidityManager ,
1054
1054
D :: Target : ChangeDestinationSourceSync ,
1055
1055
O :: Target : ' static + OutputSpender ,
1056
- K :: Target : ' static + KVStore ,
1056
+ K :: Target : ' static + KVStoreSync ,
1057
1057
{
1058
1058
let stop_thread = Arc :: new ( AtomicBool :: new ( false ) ) ;
1059
1059
let stop_thread_clone = Arc :: clone ( & stop_thread) ;
@@ -1226,7 +1226,8 @@ mod tests {
1226
1226
use lightning:: types:: payment:: PaymentHash ;
1227
1227
use lightning:: util:: config:: UserConfig ;
1228
1228
use lightning:: util:: persist:: {
1229
- KVStore , CHANNEL_MANAGER_PERSISTENCE_KEY , CHANNEL_MANAGER_PERSISTENCE_PRIMARY_NAMESPACE ,
1229
+ KVStoreSync , CHANNEL_MANAGER_PERSISTENCE_KEY ,
1230
+ CHANNEL_MANAGER_PERSISTENCE_PRIMARY_NAMESPACE ,
1230
1231
CHANNEL_MANAGER_PERSISTENCE_SECONDARY_NAMESPACE , NETWORK_GRAPH_PERSISTENCE_KEY ,
1231
1232
NETWORK_GRAPH_PERSISTENCE_PRIMARY_NAMESPACE , NETWORK_GRAPH_PERSISTENCE_SECONDARY_NAMESPACE ,
1232
1233
SCORER_PERSISTENCE_KEY , SCORER_PERSISTENCE_PRIMARY_NAMESPACE ,
@@ -1464,7 +1465,7 @@ mod tests {
1464
1465
}
1465
1466
}
1466
1467
1467
- impl KVStore for Persister {
1468
+ impl KVStoreSync for Persister {
1468
1469
fn read (
1469
1470
& self , primary_namespace : & str , secondary_namespace : & str , key : & str ,
1470
1471
) -> lightning:: io:: Result < Vec < u8 > > {
0 commit comments