Skip to content

Commit 7932aac

Browse files
committed
Rename types::NetworkGraph to types::Graph
.. as we're about to expose a new `NetworkGraph` wrapper type.
1 parent d4649e8 commit 7932aac

File tree

5 files changed

+18
-21
lines changed

5 files changed

+18
-21
lines changed

src/builder.rs

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -15,7 +15,7 @@ use crate::payment::store::PaymentStore;
1515
use crate::peer_store::PeerStore;
1616
use crate::tx_broadcaster::TransactionBroadcaster;
1717
use crate::types::{
18-
ChainMonitor, ChannelManager, DynStore, GossipSync, KeysManager, MessageRouter, NetworkGraph,
18+
ChainMonitor, ChannelManager, DynStore, GossipSync, Graph, KeysManager, MessageRouter,
1919
OnionMessenger, PeerManager,
2020
};
2121
use crate::wallet::Wallet;
@@ -633,7 +633,7 @@ fn build_with_store_internal(
633633
Ok(graph) => Arc::new(graph),
634634
Err(e) => {
635635
if e.kind() == std::io::ErrorKind::NotFound {
636-
Arc::new(NetworkGraph::new(config.network.into(), Arc::clone(&logger)))
636+
Arc::new(Graph::new(config.network.into(), Arc::clone(&logger)))
637637
} else {
638638
return Err(BuildError::ReadFailed);
639639
}

src/event.rs

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
use crate::types::{DynStore, Sweeper, Wallet};
22
use crate::{
3-
hex_utils, BumpTransactionEventHandler, ChannelManager, Config, Error, NetworkGraph, PeerInfo,
3+
hex_utils, BumpTransactionEventHandler, ChannelManager, Config, Error, Graph, PeerInfo,
44
PeerStore, UserChannelId,
55
};
66

@@ -319,7 +319,7 @@ where
319319
bump_tx_event_handler: Arc<BumpTransactionEventHandler>,
320320
channel_manager: Arc<ChannelManager>,
321321
output_sweeper: Arc<Sweeper>,
322-
network_graph: Arc<NetworkGraph>,
322+
network_graph: Arc<Graph>,
323323
payment_store: Arc<PaymentStore<L>>,
324324
peer_store: Arc<PeerStore<L>>,
325325
runtime: Arc<RwLock<Option<tokio::runtime::Runtime>>>,
@@ -335,7 +335,7 @@ where
335335
event_queue: Arc<EventQueue<L>>, wallet: Arc<Wallet>,
336336
bump_tx_event_handler: Arc<BumpTransactionEventHandler>,
337337
channel_manager: Arc<ChannelManager>, output_sweeper: Arc<Sweeper>,
338-
network_graph: Arc<NetworkGraph>, payment_store: Arc<PaymentStore<L>>,
338+
network_graph: Arc<Graph>, payment_store: Arc<PaymentStore<L>>,
339339
peer_store: Arc<PeerStore<L>>, runtime: Arc<RwLock<Option<tokio::runtime::Runtime>>>,
340340
logger: L, config: Arc<Config>,
341341
) -> Self {

src/gossip.rs

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
use crate::config::RGS_SYNC_TIMEOUT_SECS;
22
use crate::logger::{log_trace, FilesystemLogger, Logger};
3-
use crate::types::{GossipSync, NetworkGraph, P2PGossipSync, RapidGossipSync};
3+
use crate::types::{GossipSync, Graph, P2PGossipSync, RapidGossipSync};
44
use crate::Error;
55

66
use lightning::routing::utxo::UtxoLookup;
@@ -22,7 +22,7 @@ pub(crate) enum GossipSource {
2222
}
2323

2424
impl GossipSource {
25-
pub fn new_p2p(network_graph: Arc<NetworkGraph>, logger: Arc<FilesystemLogger>) -> Self {
25+
pub fn new_p2p(network_graph: Arc<Graph>, logger: Arc<FilesystemLogger>) -> Self {
2626
let gossip_sync = Arc::new(P2PGossipSync::new(
2727
network_graph,
2828
None::<Arc<dyn UtxoLookup + Send + Sync>>,
@@ -32,7 +32,7 @@ impl GossipSource {
3232
}
3333

3434
pub fn new_rgs(
35-
server_url: String, latest_sync_timestamp: u32, network_graph: Arc<NetworkGraph>,
35+
server_url: String, latest_sync_timestamp: u32, network_graph: Arc<Graph>,
3636
logger: Arc<FilesystemLogger>,
3737
) -> Self {
3838
let gossip_sync = Arc::new(RapidGossipSync::new(network_graph, Arc::clone(&logger)));

src/lib.rs

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -134,7 +134,7 @@ use payment::{Bolt11Payment, OnchainPayment, PaymentDetails, SpontaneousPayment}
134134
use peer_store::{PeerInfo, PeerStore};
135135
use types::{
136136
Broadcaster, BumpTransactionEventHandler, ChainMonitor, ChannelManager, DynStore, FeeEstimator,
137-
KeysManager, NetworkGraph, PeerManager, Router, Scorer, Sweeper, Wallet,
137+
Graph, KeysManager, PeerManager, Router, Scorer, Sweeper, Wallet,
138138
};
139139
pub use types::{ChannelDetails, ChannelType, PeerDetails, UserChannelId};
140140

@@ -184,7 +184,7 @@ pub struct Node {
184184
peer_manager: Arc<PeerManager>,
185185
connection_manager: Arc<ConnectionManager<Arc<FilesystemLogger>>>,
186186
keys_manager: Arc<KeysManager>,
187-
network_graph: Arc<NetworkGraph>,
187+
network_graph: Arc<Graph>,
188188
gossip_source: Arc<GossipSource>,
189189
liquidity_source: Option<Arc<LiquiditySource<Arc<FilesystemLogger>>>>,
190190
kv_store: Arc<DynStore>,

src/types.rs

Lines changed: 8 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -80,31 +80,28 @@ pub(crate) type KeysManager = crate::wallet::WalletKeysManager<
8080
>;
8181

8282
pub(crate) type Router = DefaultRouter<
83-
Arc<NetworkGraph>,
83+
Arc<Graph>,
8484
Arc<FilesystemLogger>,
8585
Arc<KeysManager>,
8686
Arc<Mutex<Scorer>>,
8787
ProbabilisticScoringFeeParameters,
8888
Scorer,
8989
>;
90-
pub(crate) type Scorer = ProbabilisticScorer<Arc<NetworkGraph>, Arc<FilesystemLogger>>;
90+
pub(crate) type Scorer = ProbabilisticScorer<Arc<Graph>, Arc<FilesystemLogger>>;
9191

92-
pub(crate) type NetworkGraph = gossip::NetworkGraph<Arc<FilesystemLogger>>;
92+
pub(crate) type Graph = gossip::NetworkGraph<Arc<FilesystemLogger>>;
9393

9494
pub(crate) type UtxoLookup = dyn lightning::routing::utxo::UtxoLookup + Send + Sync;
9595

96-
pub(crate) type P2PGossipSync = lightning::routing::gossip::P2PGossipSync<
97-
Arc<NetworkGraph>,
98-
Arc<UtxoLookup>,
99-
Arc<FilesystemLogger>,
100-
>;
96+
pub(crate) type P2PGossipSync =
97+
lightning::routing::gossip::P2PGossipSync<Arc<Graph>, Arc<UtxoLookup>, Arc<FilesystemLogger>>;
10198
pub(crate) type RapidGossipSync =
102-
lightning_rapid_gossip_sync::RapidGossipSync<Arc<NetworkGraph>, Arc<FilesystemLogger>>;
99+
lightning_rapid_gossip_sync::RapidGossipSync<Arc<Graph>, Arc<FilesystemLogger>>;
103100

104101
pub(crate) type GossipSync = lightning_background_processor::GossipSync<
105102
Arc<P2PGossipSync>,
106103
Arc<RapidGossipSync>,
107-
Arc<NetworkGraph>,
104+
Arc<Graph>,
108105
Arc<UtxoLookup>,
109106
Arc<FilesystemLogger>,
110107
>;
@@ -120,7 +117,7 @@ pub(crate) type OnionMessenger = lightning::onion_message::messenger::OnionMesse
120117
>;
121118

122119
pub(crate) type MessageRouter = lightning::onion_message::messenger::DefaultMessageRouter<
123-
Arc<NetworkGraph>,
120+
Arc<Graph>,
124121
Arc<FilesystemLogger>,
125122
Arc<KeysManager>,
126123
>;

0 commit comments

Comments
 (0)