From 574870e9f8faf44244dbfec2d146eb69e245d660 Mon Sep 17 00:00:00 2001 From: Jeffrey Czyz Date: Thu, 2 Jun 2022 12:53:34 -0700 Subject: [PATCH] Move network_graph.rs to gossip.rs The routing::network_graph module contains a few structs related to p2p gossip. So renaming the module to 'gossip' seems more appropriate. --- fuzz/src/full_stack.rs | 2 +- fuzz/src/process_network_graph.rs | 2 +- fuzz/src/router.rs | 2 +- lightning-background-processor/src/lib.rs | 8 ++++---- lightning-invoice/src/de.rs | 4 ++-- lightning-invoice/src/lib.rs | 2 +- lightning-invoice/src/payment.rs | 4 ++-- lightning-invoice/src/utils.rs | 4 ++-- lightning-invoice/tests/ser_de.rs | 2 +- lightning-rapid-gossip-sync/src/lib.rs | 8 ++++---- lightning-rapid-gossip-sync/src/processing.rs | 4 ++-- lightning/src/ln/channelmanager.rs | 2 +- lightning/src/ln/functional_test_utils.rs | 6 +++--- lightning/src/ln/mod.rs | 2 +- lightning/src/ln/onion_route_tests.rs | 2 +- lightning/src/ln/onion_utils.rs | 2 +- lightning/src/ln/peer_handler.rs | 4 ++-- lightning/src/ln/priv_short_conf_tests.rs | 2 +- lightning/src/routing/{network_graph.rs => gossip.rs} | 2 +- lightning/src/routing/mod.rs | 2 +- lightning/src/routing/router.rs | 4 ++-- lightning/src/routing/scoring.rs | 8 ++++---- lightning/src/util/events.rs | 6 +++--- lightning/src/util/persist.rs | 2 +- 24 files changed, 43 insertions(+), 43 deletions(-) rename lightning/src/routing/{network_graph.rs => gossip.rs} (99%) diff --git a/fuzz/src/full_stack.rs b/fuzz/src/full_stack.rs index 1c9c590f8..a59d78e1c 100644 --- a/fuzz/src/full_stack.rs +++ b/fuzz/src/full_stack.rs @@ -37,7 +37,7 @@ use lightning::ln::channelmanager::{ChainParameters, ChannelManager}; use lightning::ln::peer_handler::{MessageHandler,PeerManager,SocketDescriptor,IgnoringMessageHandler}; use lightning::ln::msgs::DecodeError; use lightning::ln::script::ShutdownScript; -use lightning::routing::network_graph::{P2PGossipSync, NetworkGraph}; +use lightning::routing::gossip::{P2PGossipSync, NetworkGraph}; use lightning::routing::router::{find_route, PaymentParameters, RouteParameters}; use lightning::routing::scoring::FixedPenaltyScorer; use lightning::util::config::UserConfig; diff --git a/fuzz/src/process_network_graph.rs b/fuzz/src/process_network_graph.rs index a71ae0e22..118862569 100644 --- a/fuzz/src/process_network_graph.rs +++ b/fuzz/src/process_network_graph.rs @@ -5,7 +5,7 @@ use utils::test_logger; /// Actual fuzz test, method signature and name are fixed fn do_test(data: &[u8]) { let block_hash = bitcoin::BlockHash::default(); - let network_graph = lightning::routing::network_graph::NetworkGraph::new(block_hash); + let network_graph = lightning::routing::gossip::NetworkGraph::new(block_hash); let rapid_sync = RapidGossipSync::new(&network_graph); let _ = rapid_sync.update_network_graph(data); } diff --git a/fuzz/src/router.rs b/fuzz/src/router.rs index 9f4fd512c..ec12ff7e1 100644 --- a/fuzz/src/router.rs +++ b/fuzz/src/router.rs @@ -16,11 +16,11 @@ use lightning::chain::transaction::OutPoint; use lightning::ln::channelmanager::{ChannelDetails, ChannelCounterparty}; use lightning::ln::features::InitFeatures; use lightning::ln::msgs; +use lightning::routing::gossip::{NetworkGraph, RoutingFees}; use lightning::routing::router::{find_route, PaymentParameters, RouteHint, RouteHintHop, RouteParameters}; use lightning::routing::scoring::FixedPenaltyScorer; use lightning::util::logger::Logger; use lightning::util::ser::Readable; -use lightning::routing::network_graph::{NetworkGraph, RoutingFees}; use bitcoin::hashes::Hash; use bitcoin::secp256k1::PublicKey; diff --git a/lightning-background-processor/src/lib.rs b/lightning-background-processor/src/lib.rs index 9783f9e7e..2e947a704 100644 --- a/lightning-background-processor/src/lib.rs +++ b/lightning-background-processor/src/lib.rs @@ -18,7 +18,7 @@ use lightning::chain::keysinterface::{Sign, KeysInterface}; use lightning::ln::channelmanager::ChannelManager; use lightning::ln::msgs::{ChannelMessageHandler, RoutingMessageHandler}; use lightning::ln::peer_handler::{CustomMessageHandler, PeerManager, SocketDescriptor}; -use lightning::routing::network_graph::{NetworkGraph, P2PGossipSync}; +use lightning::routing::gossip::{NetworkGraph, P2PGossipSync}; use lightning::routing::scoring::WriteableScore; use lightning::util::events::{Event, EventHandler, EventsProvider}; use lightning::util::logger::Logger; @@ -162,8 +162,8 @@ impl BackgroundProcessor { /// [`ChannelManager::write`]: lightning::ln::channelmanager::ChannelManager#impl-Writeable /// [`Persister::persist_manager`]: lightning::util::persist::Persister::persist_manager /// [`Persister::persist_graph`]: lightning::util::persist::Persister::persist_graph - /// [`NetworkGraph`]: lightning::routing::network_graph::NetworkGraph - /// [`NetworkGraph::write`]: lightning::routing::network_graph::NetworkGraph#impl-Writeable + /// [`NetworkGraph`]: lightning::routing::gossip::NetworkGraph + /// [`NetworkGraph::write`]: lightning::routing::gossip::NetworkGraph#impl-Writeable pub fn start< 'a, Signer: 'static + Sign, @@ -408,7 +408,7 @@ mod tests { use lightning::ln::features::{ChannelFeatures, InitFeatures}; use lightning::ln::msgs::{ChannelMessageHandler, Init}; use lightning::ln::peer_handler::{PeerManager, MessageHandler, SocketDescriptor, IgnoringMessageHandler}; - use lightning::routing::network_graph::{NetworkGraph, P2PGossipSync}; + use lightning::routing::gossip::{NetworkGraph, P2PGossipSync}; use lightning::util::config::UserConfig; use lightning::util::events::{Event, MessageSendEventsProvider, MessageSendEvent}; use lightning::util::ser::Writeable; diff --git a/lightning-invoice/src/de.rs b/lightning-invoice/src/de.rs index e9b639c10..b4eb04a3d 100644 --- a/lightning-invoice/src/de.rs +++ b/lightning-invoice/src/de.rs @@ -13,7 +13,7 @@ use bitcoin_hashes::Hash; use bitcoin_hashes::sha256; use crate::prelude::*; use lightning::ln::PaymentSecret; -use lightning::routing::network_graph::RoutingFees; +use lightning::routing::gossip::RoutingFees; use lightning::routing::router::{RouteHint, RouteHintHop}; use num_traits::{CheckedAdd, CheckedMul}; @@ -909,7 +909,7 @@ mod test { #[test] fn test_parse_route() { - use lightning::routing::network_graph::RoutingFees; + use lightning::routing::gossip::RoutingFees; use lightning::routing::router::{RouteHint, RouteHintHop}; use ::PrivateRoute; use bech32::FromBase32; diff --git a/lightning-invoice/src/lib.rs b/lightning-invoice/src/lib.rs index 008d3344b..609b33b2d 100644 --- a/lightning-invoice/src/lib.rs +++ b/lightning-invoice/src/lib.rs @@ -45,7 +45,7 @@ use bitcoin_hashes::sha256; use lightning::ln::PaymentSecret; use lightning::ln::features::InvoiceFeatures; #[cfg(any(doc, test))] -use lightning::routing::network_graph::RoutingFees; +use lightning::routing::gossip::RoutingFees; use lightning::routing::router::RouteHint; use lightning::util::invoice::construct_invoice_preimage; diff --git a/lightning-invoice/src/payment.rs b/lightning-invoice/src/payment.rs index c095f74dd..e672b89c9 100644 --- a/lightning-invoice/src/payment.rs +++ b/lightning-invoice/src/payment.rs @@ -38,7 +38,7 @@ //! # use lightning::ln::{PaymentHash, PaymentPreimage, PaymentSecret}; //! # use lightning::ln::channelmanager::{ChannelDetails, PaymentId, PaymentSendFailure}; //! # use lightning::ln::msgs::LightningError; -//! # use lightning::routing::network_graph::NodeId; +//! # use lightning::routing::gossip::NodeId; //! # use lightning::routing::router::{Route, RouteHop, RouteParameters}; //! # use lightning::routing::scoring::{ChannelUsage, Score}; //! # use lightning::util::events::{Event, EventHandler, EventsProvider}; @@ -602,7 +602,7 @@ mod tests { use lightning::ln::features::{ChannelFeatures, NodeFeatures, InitFeatures}; use lightning::ln::functional_test_utils::*; use lightning::ln::msgs::{ChannelMessageHandler, ErrorAction, LightningError}; - use lightning::routing::network_graph::NodeId; + use lightning::routing::gossip::NodeId; use lightning::routing::router::{PaymentParameters, Route, RouteHop}; use lightning::routing::scoring::ChannelUsage; use lightning::util::test_utils::TestLogger; diff --git a/lightning-invoice/src/utils.rs b/lightning-invoice/src/utils.rs index 9f6691564..04cfb3f14 100644 --- a/lightning-invoice/src/utils.rs +++ b/lightning-invoice/src/utils.rs @@ -15,9 +15,9 @@ use lightning::ln::channelmanager::{ChannelDetails, ChannelManager, PaymentId, P use lightning::ln::channelmanager::{PhantomRouteHints, MIN_CLTV_EXPIRY_DELTA}; use lightning::ln::inbound_payment::{create, create_from_hash, ExpandedKey}; use lightning::ln::msgs::LightningError; -use lightning::routing::scoring::Score; -use lightning::routing::network_graph::{NetworkGraph, RoutingFees}; +use lightning::routing::gossip::{NetworkGraph, RoutingFees}; use lightning::routing::router::{Route, RouteHint, RouteHintHop, RouteParameters, find_route}; +use lightning::routing::scoring::Score; use lightning::util::logger::Logger; use secp256k1::PublicKey; use core::ops::Deref; diff --git a/lightning-invoice/tests/ser_de.rs b/lightning-invoice/tests/ser_de.rs index 1d9c48151..ffac702ce 100644 --- a/lightning-invoice/tests/ser_de.rs +++ b/lightning-invoice/tests/ser_de.rs @@ -9,8 +9,8 @@ use bitcoin_hashes::hex::FromHex; use bitcoin_hashes::{sha256, Hash}; use bech32::u5; use lightning::ln::PaymentSecret; +use lightning::routing::gossip::RoutingFees; use lightning::routing::router::{RouteHint, RouteHintHop}; -use lightning::routing::network_graph::RoutingFees; use lightning_invoice::*; use secp256k1::PublicKey; use secp256k1::ecdsa::{RecoverableSignature, RecoveryId}; diff --git a/lightning-rapid-gossip-sync/src/lib.rs b/lightning-rapid-gossip-sync/src/lib.rs index d07a19fda..278cede39 100644 --- a/lightning-rapid-gossip-sync/src/lib.rs +++ b/lightning-rapid-gossip-sync/src/lib.rs @@ -29,7 +29,7 @@ //! ``` //! use bitcoin::blockdata::constants::genesis_block; //! use bitcoin::Network; -//! use lightning::routing::network_graph::NetworkGraph; +//! use lightning::routing::gossip::NetworkGraph; //! use lightning_rapid_gossip_sync::RapidGossipSync; //! //! let block_hash = genesis_block(Network::Bitcoin).header.block_hash(); @@ -62,7 +62,7 @@ use std::fs::File; use std::ops::Deref; use std::sync::atomic::{AtomicBool, Ordering}; -use lightning::routing::network_graph::NetworkGraph; +use lightning::routing::gossip::NetworkGraph; use crate::error::GraphSyncError; @@ -127,7 +127,7 @@ mod tests { use bitcoin::Network; use lightning::ln::msgs::DecodeError; - use lightning::routing::network_graph::NetworkGraph; + use lightning::routing::gossip::NetworkGraph; use crate::RapidGossipSync; #[test] @@ -253,7 +253,7 @@ pub mod bench { use bitcoin::Network; use lightning::ln::msgs::DecodeError; - use lightning::routing::network_graph::NetworkGraph; + use lightning::routing::gossip::NetworkGraph; use crate::RapidGossipSync; diff --git a/lightning-rapid-gossip-sync/src/processing.rs b/lightning-rapid-gossip-sync/src/processing.rs index 6ffc6f58e..21c1ce29a 100644 --- a/lightning-rapid-gossip-sync/src/processing.rs +++ b/lightning-rapid-gossip-sync/src/processing.rs @@ -10,7 +10,7 @@ use bitcoin::secp256k1::PublicKey; use lightning::ln::msgs::{ DecodeError, ErrorAction, LightningError, OptionalField, UnsignedChannelUpdate, }; -use lightning::routing::network_graph::NetworkGraph; +use lightning::routing::gossip::NetworkGraph; use lightning::util::ser::{BigSize, Readable}; use crate::error::GraphSyncError; @@ -235,7 +235,7 @@ mod tests { use bitcoin::Network; use lightning::ln::msgs::DecodeError; - use lightning::routing::network_graph::NetworkGraph; + use lightning::routing::gossip::NetworkGraph; use crate::error::GraphSyncError; use crate::RapidGossipSync; diff --git a/lightning/src/ln/channelmanager.rs b/lightning/src/ln/channelmanager.rs index cb2381f9c..1d43fa0a4 100644 --- a/lightning/src/ln/channelmanager.rs +++ b/lightning/src/ln/channelmanager.rs @@ -7567,7 +7567,7 @@ pub mod bench { use ln::features::{InitFeatures, InvoiceFeatures}; use ln::functional_test_utils::*; use ln::msgs::{ChannelMessageHandler, Init}; - use routing::network_graph::NetworkGraph; + use routing::gossip::NetworkGraph; use routing::router::{PaymentParameters, get_route}; use util::test_utils; use util::config::UserConfig; diff --git a/lightning/src/ln/functional_test_utils.rs b/lightning/src/ln/functional_test_utils.rs index 48656c81e..594f02fc5 100644 --- a/lightning/src/ln/functional_test_utils.rs +++ b/lightning/src/ln/functional_test_utils.rs @@ -15,7 +15,7 @@ use chain::channelmonitor::ChannelMonitor; use chain::transaction::OutPoint; use ln::{PaymentPreimage, PaymentHash, PaymentSecret}; use ln::channelmanager::{ChainParameters, ChannelManager, ChannelManagerReadArgs, RAACommitmentOrder, PaymentSendFailure, PaymentId, MIN_CLTV_EXPIRY_DELTA}; -use routing::network_graph::{P2PGossipSync, NetworkGraph}; +use routing::gossip::{P2PGossipSync, NetworkGraph}; use routing::router::{PaymentParameters, Route, get_route}; use ln::features::{InitFeatures, InvoiceFeatures}; use ln::msgs; @@ -1506,13 +1506,13 @@ macro_rules! expect_payment_failed_conditions { if let Some(chan_closed) = $conditions.expected_blamed_chan_closed { match network_update { - &Some($crate::routing::network_graph::NetworkUpdate::ChannelUpdateMessage { ref msg }) if !chan_closed => { + &Some($crate::routing::gossip::NetworkUpdate::ChannelUpdateMessage { ref msg }) if !chan_closed => { if let Some(scid) = $conditions.expected_blamed_scid { assert_eq!(msg.contents.short_channel_id, scid); } assert_eq!(msg.contents.flags & 2, 0); }, - &Some($crate::routing::network_graph::NetworkUpdate::ChannelFailure { short_channel_id, is_permanent }) if chan_closed => { + &Some($crate::routing::gossip::NetworkUpdate::ChannelFailure { short_channel_id, is_permanent }) if chan_closed => { if let Some(scid) = $conditions.expected_blamed_scid { assert_eq!(short_channel_id, scid); } diff --git a/lightning/src/ln/mod.rs b/lightning/src/ln/mod.rs index 932ca70b0..9522e83d1 100644 --- a/lightning/src/ln/mod.rs +++ b/lightning/src/ln/mod.rs @@ -19,7 +19,7 @@ //! call into your [`P2PGossipSync`]. //! //! [`ChannelManager`]: channelmanager::ChannelManager -//! [`P2PGossipSync`]: crate::routing::network_graph::P2PGossipSync +//! [`P2PGossipSync`]: crate::routing::gossip::P2PGossipSync #[cfg(any(test, feature = "_test_utils"))] #[macro_use] diff --git a/lightning/src/ln/onion_route_tests.rs b/lightning/src/ln/onion_route_tests.rs index 1c3203eda..eabd22220 100644 --- a/lightning/src/ln/onion_route_tests.rs +++ b/lightning/src/ln/onion_route_tests.rs @@ -16,7 +16,7 @@ use chain::keysinterface::{KeysInterface, Recipient}; use ln::{PaymentHash, PaymentSecret}; use ln::channelmanager::{HTLCForwardInfo, CLTV_FAR_FAR_AWAY, MIN_CLTV_EXPIRY_DELTA, PendingHTLCInfo, PendingHTLCRouting}; use ln::onion_utils; -use routing::network_graph::{NetworkUpdate, RoutingFees, NodeId}; +use routing::gossip::{NetworkUpdate, RoutingFees, NodeId}; use routing::router::{get_route, PaymentParameters, Route, RouteHint, RouteHintHop}; use ln::features::{InitFeatures, InvoiceFeatures, NodeFeatures}; use ln::msgs; diff --git a/lightning/src/ln/onion_utils.rs b/lightning/src/ln/onion_utils.rs index 02676b73b..1df374d7e 100644 --- a/lightning/src/ln/onion_utils.rs +++ b/lightning/src/ln/onion_utils.rs @@ -11,7 +11,7 @@ use ln::{PaymentHash, PaymentPreimage, PaymentSecret}; use ln::channelmanager::HTLCSource; use ln::msgs; use ln::wire::Encode; -use routing::network_graph::NetworkUpdate; +use routing::gossip::NetworkUpdate; use routing::router::RouteHop; use util::chacha20::{ChaCha20, ChaChaReader}; use util::errors::{self, APIError}; diff --git a/lightning/src/ln/peer_handler.rs b/lightning/src/ln/peer_handler.rs index 160c397bd..d86cddb13 100644 --- a/lightning/src/ln/peer_handler.rs +++ b/lightning/src/ln/peer_handler.rs @@ -25,10 +25,10 @@ use util::ser::{VecWriter, Writeable, Writer}; use ln::peer_channel_encryptor::{PeerChannelEncryptor,NextNoiseStep}; use ln::wire; use ln::wire::Encode; +use routing::gossip::{NetworkGraph, P2PGossipSync}; use util::atomic_counter::AtomicCounter; use util::events::{MessageSendEvent, MessageSendEventsProvider}; use util::logger::Logger; -use routing::network_graph::{NetworkGraph, P2PGossipSync}; use prelude::*; use io; @@ -210,7 +210,7 @@ pub struct MessageHandler where /// A message handler which handles messages updating our knowledge of the network channel /// graph. Usually this is just a [`P2PGossipSync`] object or an [`IgnoringMessageHandler`]. /// - /// [`P2PGossipSync`]: crate::routing::network_graph::P2PGossipSync + /// [`P2PGossipSync`]: crate::routing::gossip::P2PGossipSync pub route_handler: RM, } diff --git a/lightning/src/ln/priv_short_conf_tests.rs b/lightning/src/ln/priv_short_conf_tests.rs index 81bedbabb..13f66805b 100644 --- a/lightning/src/ln/priv_short_conf_tests.rs +++ b/lightning/src/ln/priv_short_conf_tests.rs @@ -15,7 +15,7 @@ use chain::{ChannelMonitorUpdateErr, Watch}; use chain::channelmonitor::ChannelMonitor; use chain::keysinterface::{Recipient, KeysInterface}; use ln::channelmanager::{ChannelManager, ChannelManagerReadArgs, MIN_CLTV_EXPIRY_DELTA}; -use routing::network_graph::RoutingFees; +use routing::gossip::RoutingFees; use routing::router::{PaymentParameters, RouteHint, RouteHintHop}; use ln::features::{InitFeatures, InvoiceFeatures}; use ln::msgs; diff --git a/lightning/src/routing/network_graph.rs b/lightning/src/routing/gossip.rs similarity index 99% rename from lightning/src/routing/network_graph.rs rename to lightning/src/routing/gossip.rs index 0fccb3253..52cda7173 100644 --- a/lightning/src/routing/network_graph.rs +++ b/lightning/src/routing/gossip.rs @@ -1643,7 +1643,7 @@ mod tests { use chain; use ln::PaymentHash; use ln::features::{ChannelFeatures, InitFeatures, NodeFeatures}; - use routing::network_graph::{P2PGossipSync, NetworkGraph, NetworkUpdate, MAX_EXCESS_BYTES_FOR_RELAY}; + use routing::gossip::{P2PGossipSync, NetworkGraph, NetworkUpdate, MAX_EXCESS_BYTES_FOR_RELAY}; use ln::msgs::{Init, OptionalField, RoutingMessageHandler, UnsignedNodeAnnouncement, NodeAnnouncement, UnsignedChannelAnnouncement, ChannelAnnouncement, UnsignedChannelUpdate, ChannelUpdate, ReplyChannelRange, QueryChannelRange, QueryShortChannelIds, MAX_VALUE_MSAT}; diff --git a/lightning/src/routing/mod.rs b/lightning/src/routing/mod.rs index a3ab6c0c1..c7babbe30 100644 --- a/lightning/src/routing/mod.rs +++ b/lightning/src/routing/mod.rs @@ -9,6 +9,6 @@ //! Structs and impls for receiving messages about the network and storing the topology live here. -pub mod network_graph; +pub mod gossip; pub mod router; pub mod scoring; diff --git a/lightning/src/routing/router.rs b/lightning/src/routing/router.rs index 9bf48501c..301ae76dd 100644 --- a/lightning/src/routing/router.rs +++ b/lightning/src/routing/router.rs @@ -17,8 +17,8 @@ use bitcoin::secp256k1::PublicKey; use ln::channelmanager::ChannelDetails; use ln::features::{ChannelFeatures, InvoiceFeatures, NodeFeatures}; use ln::msgs::{DecodeError, ErrorAction, LightningError, MAX_VALUE_MSAT}; +use routing::gossip::{DirectedChannelInfoWithUpdate, EffectiveCapacity, NetworkGraph, ReadOnlyNetworkGraph, NodeId, RoutingFees}; use routing::scoring::{ChannelUsage, Score}; -use routing::network_graph::{DirectedChannelInfoWithUpdate, EffectiveCapacity, NetworkGraph, ReadOnlyNetworkGraph, NodeId, RoutingFees}; use util::ser::{Writeable, Readable, Writer}; use util::logger::{Level, Logger}; use util::chacha20::ChaCha20; @@ -1858,7 +1858,7 @@ fn build_route_from_hops_internal( #[cfg(test)] mod tests { - use routing::network_graph::{NetworkGraph, P2PGossipSync, NodeId}; + use routing::gossip::{NetworkGraph, P2PGossipSync, NodeId}; use routing::router::{get_route, build_route_from_hops_internal, add_random_cltv_offset, default_node_features, PaymentParameters, Route, RouteHint, RouteHintHop, RouteHop, RoutingFees, DEFAULT_MAX_TOTAL_CLTV_EXPIRY_DELTA, MAX_PATH_LENGTH_ESTIMATE}; diff --git a/lightning/src/routing/scoring.rs b/lightning/src/routing/scoring.rs index 339979b1b..54400624d 100644 --- a/lightning/src/routing/scoring.rs +++ b/lightning/src/routing/scoring.rs @@ -17,7 +17,7 @@ //! ``` //! # extern crate bitcoin; //! # -//! # use lightning::routing::network_graph::NetworkGraph; +//! # use lightning::routing::gossip::NetworkGraph; //! # use lightning::routing::router::{RouteParameters, find_route}; //! # use lightning::routing::scoring::{ProbabilisticScorer, ProbabilisticScoringParameters}; //! # use lightning::chain::keysinterface::{KeysManager, KeysInterface}; @@ -55,7 +55,7 @@ //! [`find_route`]: crate::routing::router::find_route use ln::msgs::DecodeError; -use routing::network_graph::{EffectiveCapacity, NetworkGraph, NodeId}; +use routing::gossip::{EffectiveCapacity, NetworkGraph, NodeId}; use routing::router::RouteHop; use util::ser::{Readable, ReadableArgs, Writeable, Writer}; use util::logger::Logger; @@ -1120,9 +1120,9 @@ mod tests { use ln::features::{ChannelFeatures, NodeFeatures}; use ln::msgs::{ChannelAnnouncement, ChannelUpdate, OptionalField, UnsignedChannelAnnouncement, UnsignedChannelUpdate}; - use routing::scoring::{ChannelUsage, Score}; - use routing::network_graph::{EffectiveCapacity, NetworkGraph, NodeId}; + use routing::gossip::{EffectiveCapacity, NetworkGraph, NodeId}; use routing::router::RouteHop; + use routing::scoring::{ChannelUsage, Score}; use util::ser::{ReadableArgs, Writeable}; use util::test_utils::TestLogger; diff --git a/lightning/src/util/events.rs b/lightning/src/util/events.rs index b00cf74e0..db5b064f1 100644 --- a/lightning/src/util/events.rs +++ b/lightning/src/util/events.rs @@ -21,7 +21,7 @@ use ln::features::ChannelTypeFeatures; use ln::msgs; use ln::msgs::DecodeError; use ln::{PaymentPreimage, PaymentHash, PaymentSecret}; -use routing::network_graph::NetworkUpdate; +use routing::gossip::NetworkUpdate; use util::ser::{BigSize, FixedLengthReader, Writeable, Writer, MaybeReadable, Readable, VecReadWrapper, VecWriteWrapper}; use routing::router::{RouteHop, RouteParameters}; @@ -339,8 +339,8 @@ pub enum Event { /// Should be applied to the [`NetworkGraph`] so that routing decisions can take into /// account the update. [`P2PGossipSync`] is capable of doing this. /// - /// [`NetworkGraph`]: crate::routing::network_graph::NetworkGraph - /// [`P2PGossipSync`]: crate::routing::network_graph::P2PGossipSync + /// [`NetworkGraph`]: crate::routing::gossip::NetworkGraph + /// [`P2PGossipSync`]: crate::routing::gossip::P2PGossipSync network_update: Option, /// For both single-path and multi-path payments, this is set if all paths of the payment have /// failed. This will be set to false if (1) this is an MPP payment and (2) other parts of the diff --git a/lightning/src/util/persist.rs b/lightning/src/util/persist.rs index 5c124c21a..117eff491 100644 --- a/lightning/src/util/persist.rs +++ b/lightning/src/util/persist.rs @@ -13,7 +13,7 @@ use bitcoin::hashes::hex::ToHex; use io::{self}; use routing::scoring::WriteableScore; -use crate::{chain::{keysinterface::{Sign, KeysInterface}, self, transaction::{OutPoint}, chaininterface::{BroadcasterInterface, FeeEstimator}, chainmonitor::{Persist, MonitorUpdateId}, channelmonitor::{ChannelMonitor, ChannelMonitorUpdate}}, ln::channelmanager::ChannelManager, routing::network_graph::NetworkGraph}; +use crate::{chain::{keysinterface::{Sign, KeysInterface}, self, transaction::{OutPoint}, chaininterface::{BroadcasterInterface, FeeEstimator}, chainmonitor::{Persist, MonitorUpdateId}, channelmonitor::{ChannelMonitor, ChannelMonitorUpdate}}, ln::channelmanager::ChannelManager, routing::gossip::NetworkGraph}; use super::{logger::Logger, ser::Writeable}; /// Trait for a key-value store for persisting some writeable object at some key -- 2.39.5