Skip to content

Commit ac497a3

Browse files
committed
Move channelmonitor.rs from ln to chain module
Given the chain::Watch interface is defined in terms of ChannelMonitor and ChannelMonitorUpdateErr, move channelmonitor.rs from the ln module to the chain module.
1 parent 77f9f66 commit ac497a3

16 files changed

+53
-53
lines changed

fuzz/src/chanmon_consistency.rs

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -30,11 +30,11 @@ use bitcoin::hashes::sha256::Hash as Sha256;
3030
use bitcoin::hash_types::{BlockHash, WPubkeyHash};
3131

3232
use lightning::chain;
33+
use lightning::chain::channelmonitor;
34+
use lightning::chain::channelmonitor::{ChannelMonitor, ChannelMonitorUpdateErr, MonitorEvent};
3335
use lightning::chain::transaction::OutPoint;
3436
use lightning::chain::chaininterface::{BroadcasterInterface, ConfirmationTarget, FeeEstimator};
3537
use lightning::chain::keysinterface::{KeysInterface, InMemoryChannelKeys};
36-
use lightning::ln::channelmonitor;
37-
use lightning::ln::channelmonitor::{ChannelMonitor, ChannelMonitorUpdateErr, MonitorEvent};
3838
use lightning::ln::channelmanager::{ChannelManager, PaymentHash, PaymentPreimage, PaymentSecret, ChannelManagerReadArgs};
3939
use lightning::ln::features::{ChannelFeatures, InitFeatures, NodeFeatures};
4040
use lightning::ln::msgs::{CommitmentUpdate, ChannelMessageHandler, ErrorAction, UpdateAddHTLC, Init};

fuzz/src/chanmon_deser.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3,8 +3,8 @@
33

44
use bitcoin::hash_types::BlockHash;
55

6+
use lightning::chain::channelmonitor;
67
use lightning::util::enforcing_trait_impls::EnforcingChannelKeys;
7-
use lightning::ln::channelmonitor;
88
use lightning::util::ser::{Readable, Writer};
99

1010
use utils::test_logger;

fuzz/src/full_stack.rs

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -28,9 +28,9 @@ use bitcoin::hash_types::{Txid, BlockHash, WPubkeyHash};
2828

2929
use lightning::chain;
3030
use lightning::chain::chaininterface::{BroadcasterInterface, ConfirmationTarget, FeeEstimator};
31+
use lightning::chain::channelmonitor;
3132
use lightning::chain::transaction::OutPoint;
3233
use lightning::chain::keysinterface::{InMemoryChannelKeys, KeysInterface};
33-
use lightning::ln::channelmonitor;
3434
use lightning::ln::channelmanager::{ChannelManager, PaymentHash, PaymentPreimage, PaymentSecret};
3535
use lightning::ln::peer_handler::{MessageHandler,PeerManager,SocketDescriptor};
3636
use lightning::routing::router::get_route;
@@ -901,6 +901,6 @@ mod tests {
901901
assert_eq!(log_entries.get(&("lightning::ln::peer_handler".to_string(), "Handling UpdateHTLCs event in peer_handler for node 030200000000000000000000000000000000000000000000000000000000000000 with 1 adds, 0 fulfills, 0 fails for channel 3900000000000000000000000000000000000000000000000000000000000000".to_string())), Some(&3)); // 7
902902
assert_eq!(log_entries.get(&("lightning::ln::peer_handler".to_string(), "Handling UpdateHTLCs event in peer_handler for node 030000000000000000000000000000000000000000000000000000000000000000 with 0 adds, 1 fulfills, 0 fails for channel 3d00000000000000000000000000000000000000000000000000000000000000".to_string())), Some(&1)); // 8
903903
assert_eq!(log_entries.get(&("lightning::ln::peer_handler".to_string(), "Handling UpdateHTLCs event in peer_handler for node 030000000000000000000000000000000000000000000000000000000000000000 with 0 adds, 0 fulfills, 1 fails for channel 3d00000000000000000000000000000000000000000000000000000000000000".to_string())), Some(&2)); // 9
904-
assert_eq!(log_entries.get(&("lightning::ln::channelmonitor".to_string(), "Input spending remote commitment tx (00000000000000000000000000000000000000000000000000000000000000a1:0) in 0000000000000000000000000000000000000000000000000000000000000018 resolves outbound HTLC with payment hash ff00000000000000000000000000000000000000000000000000000000000000 with timeout".to_string())), Some(&1)); // 10
904+
assert_eq!(log_entries.get(&("lightning::chain::channelmonitor".to_string(), "Input spending remote commitment tx (00000000000000000000000000000000000000000000000000000000000000a1:0) in 0000000000000000000000000000000000000000000000000000000000000018 resolves outbound HTLC with payment hash ff00000000000000000000000000000000000000000000000000000000000000 with timeout".to_string())), Some(&1)); // 10
905905
}
906906
}

lightning-net-tokio/src/lib.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -36,7 +36,7 @@
3636
//! type Logger = dyn lightning::util::logger::Logger;
3737
//! type ChainAccess = dyn lightning::chain::Access;
3838
//! type ChainNotify = dyn lightning::chain::Notify;
39-
//! type ChainMonitor = lightning::ln::channelmonitor::ChainMonitor<lightning::chain::keysinterface::InMemoryChannelKeys, Arc<ChainNotify>, Arc<TxBroadcaster>, Arc<FeeEstimator>, Arc<Logger>>;
39+
//! type ChainMonitor = lightning::chain::channelmonitor::ChainMonitor<lightning::chain::keysinterface::InMemoryChannelKeys, Arc<ChainNotify>, Arc<TxBroadcaster>, Arc<FeeEstimator>, Arc<Logger>>;
4040
//! type ChannelManager = lightning::ln::channelmanager::SimpleArcChannelManager<ChainMonitor, TxBroadcaster, FeeEstimator, Logger>;
4141
//! type PeerManager = lightning::ln::peer_handler::SimpleArcPeerManager<lightning_net_tokio::SocketDescriptor, ChainMonitor, TxBroadcaster, FeeEstimator, ChainAccess, Logger>;
4242
//!

lightning/src/ln/channelmonitor.rs renamed to lightning/src/chain/channelmonitor.rs

Lines changed: 17 additions & 17 deletions
Original file line numberDiff line numberDiff line change
@@ -65,7 +65,7 @@ use std::io::Error;
6565
#[derive(Clone)]
6666
#[must_use]
6767
pub struct ChannelMonitorUpdate {
68-
pub(super) updates: Vec<ChannelMonitorUpdateStep>,
68+
pub(crate) updates: Vec<ChannelMonitorUpdateStep>,
6969
/// The sequence number of this update. Updates *must* be replayed in-order according to this
7070
/// sequence number (and updates may panic if they are not). The update_id values are strictly
7171
/// increasing and increase by one for each new update.
@@ -170,9 +170,9 @@ pub enum MonitorEvent {
170170
/// [`chain::Watch`]: ../../chain/trait.Watch.html
171171
#[derive(Clone, PartialEq)]
172172
pub struct HTLCUpdate {
173-
pub(super) payment_hash: PaymentHash,
174-
pub(super) payment_preimage: Option<PaymentPreimage>,
175-
pub(super) source: HTLCSource
173+
pub(crate) payment_hash: PaymentHash,
174+
pub(crate) payment_preimage: Option<PaymentPreimage>,
175+
pub(crate) source: HTLCSource
176176
}
177177
impl_writeable!(HTLCUpdate, 0, { payment_hash, payment_preimage, source });
178178

@@ -715,7 +715,7 @@ const MIN_SERIALIZATION_VERSION: u8 = 1;
715715

716716
#[cfg_attr(test, derive(PartialEq))]
717717
#[derive(Clone)]
718-
pub(super) enum ChannelMonitorUpdateStep {
718+
pub(crate) enum ChannelMonitorUpdateStep {
719719
LatestLocalCommitmentTXInfo {
720720
commitment_tx: LocalCommitmentTransaction,
721721
htlc_outputs: Vec<(HTLCOutputInCommitment, Option<Signature>, Option<HTLCSource>)>,
@@ -1174,7 +1174,7 @@ impl<ChanSigner: ChannelKeys + Writeable> ChannelMonitor<ChanSigner> {
11741174
}
11751175

11761176
impl<ChanSigner: ChannelKeys> ChannelMonitor<ChanSigner> {
1177-
pub(super) fn new(keys: ChanSigner, shutdown_pubkey: &PublicKey,
1177+
pub(crate) fn new(keys: ChanSigner, shutdown_pubkey: &PublicKey,
11781178
on_remote_tx_csv: u16, destination_script: &Script, funding_info: (OutPoint, Script),
11791179
remote_htlc_base_key: &PublicKey, remote_delayed_payment_base_key: &PublicKey,
11801180
on_local_tx_csv: u16, funding_redeemscript: Script, channel_value_satoshis: u64,
@@ -1261,7 +1261,7 @@ impl<ChanSigner: ChannelKeys> ChannelMonitor<ChanSigner> {
12611261
/// Inserts a revocation secret into this channel monitor. Prunes old preimages if neither
12621262
/// needed by local commitment transactions HTCLs nor by remote ones. Unless we haven't already seen remote
12631263
/// commitment transaction's secret, they are de facto pruned (we can use revocation key).
1264-
pub(super) fn provide_secret(&mut self, idx: u64, secret: [u8; 32]) -> Result<(), MonitorUpdateError> {
1264+
fn provide_secret(&mut self, idx: u64, secret: [u8; 32]) -> Result<(), MonitorUpdateError> {
12651265
if let Err(()) = self.commitment_secrets.provide_secret(idx, secret) {
12661266
return Err(MonitorUpdateError("Previous secret did not match new one"));
12671267
}
@@ -1313,7 +1313,7 @@ impl<ChanSigner: ChannelKeys> ChannelMonitor<ChanSigner> {
13131313
/// The monitor watches for it to be broadcasted and then uses the HTLC information (and
13141314
/// possibly future revocation/preimage information) to claim outputs where possible.
13151315
/// We cache also the mapping hash:commitment number to lighten pruning of old preimages by watchtowers.
1316-
pub(super) fn provide_latest_remote_commitment_tx_info<L: Deref>(&mut self, unsigned_commitment_tx: &Transaction, htlc_outputs: Vec<(HTLCOutputInCommitment, Option<Box<HTLCSource>>)>, commitment_number: u64, their_revocation_point: PublicKey, logger: &L) where L::Target: Logger {
1316+
pub(crate) fn provide_latest_remote_commitment_tx_info<L: Deref>(&mut self, unsigned_commitment_tx: &Transaction, htlc_outputs: Vec<(HTLCOutputInCommitment, Option<Box<HTLCSource>>)>, commitment_number: u64, their_revocation_point: PublicKey, logger: &L) where L::Target: Logger {
13171317
// TODO: Encrypt the htlc_outputs data with the single-hash of the commitment transaction
13181318
// so that a remote monitor doesn't learn anything unless there is a malicious close.
13191319
// (only maybe, sadly we cant do the same for local info, as we need to be aware of
@@ -1362,7 +1362,7 @@ impl<ChanSigner: ChannelKeys> ChannelMonitor<ChanSigner> {
13621362
/// is important that any clones of this channel monitor (including remote clones) by kept
13631363
/// up-to-date as our local commitment transaction is updated.
13641364
/// Panics if set_on_local_tx_csv has never been called.
1365-
pub(super) fn provide_latest_local_commitment_tx_info(&mut self, commitment_tx: LocalCommitmentTransaction, htlc_outputs: Vec<(HTLCOutputInCommitment, Option<Signature>, Option<HTLCSource>)>) -> Result<(), MonitorUpdateError> {
1365+
fn provide_latest_local_commitment_tx_info(&mut self, commitment_tx: LocalCommitmentTransaction, htlc_outputs: Vec<(HTLCOutputInCommitment, Option<Signature>, Option<HTLCSource>)>) -> Result<(), MonitorUpdateError> {
13661366
if self.local_tx_signed {
13671367
return Err(MonitorUpdateError("A local commitment tx has already been signed, no new local commitment txn can be sent to our counterparty"));
13681368
}
@@ -1395,11 +1395,11 @@ impl<ChanSigner: ChannelKeys> ChannelMonitor<ChanSigner> {
13951395

13961396
/// Provides a payment_hash->payment_preimage mapping. Will be automatically pruned when all
13971397
/// commitment_tx_infos which contain the payment hash have been revoked.
1398-
pub(super) fn provide_payment_preimage(&mut self, payment_hash: &PaymentHash, payment_preimage: &PaymentPreimage) {
1398+
pub(crate) fn provide_payment_preimage(&mut self, payment_hash: &PaymentHash, payment_preimage: &PaymentPreimage) {
13991399
self.payment_preimages.insert(payment_hash.clone(), payment_preimage.clone());
14001400
}
14011401

1402-
pub(super) fn broadcast_latest_local_commitment_txn<B: Deref, L: Deref>(&mut self, broadcaster: &B, logger: &L)
1402+
pub(crate) fn broadcast_latest_local_commitment_txn<B: Deref, L: Deref>(&mut self, broadcaster: &B, logger: &L)
14031403
where B::Target: BroadcasterInterface,
14041404
L::Target: Logger,
14051405
{
@@ -1500,19 +1500,19 @@ impl<ChanSigner: ChannelKeys> ChannelMonitor<ChanSigner> {
15001500
}
15011501

15021502
/// Can only fail if idx is < get_min_seen_secret
1503-
pub(super) fn get_secret(&self, idx: u64) -> Option<[u8; 32]> {
1503+
fn get_secret(&self, idx: u64) -> Option<[u8; 32]> {
15041504
self.commitment_secrets.get_secret(idx)
15051505
}
15061506

1507-
pub(super) fn get_min_seen_secret(&self) -> u64 {
1507+
pub(crate) fn get_min_seen_secret(&self) -> u64 {
15081508
self.commitment_secrets.get_min_seen_secret()
15091509
}
15101510

1511-
pub(super) fn get_cur_remote_commitment_number(&self) -> u64 {
1511+
pub(crate) fn get_cur_remote_commitment_number(&self) -> u64 {
15121512
self.current_remote_commitment_number
15131513
}
15141514

1515-
pub(super) fn get_cur_local_commitment_number(&self) -> u64 {
1515+
pub(crate) fn get_cur_local_commitment_number(&self) -> u64 {
15161516
self.current_local_commitment_number
15171517
}
15181518

@@ -2040,7 +2040,7 @@ impl<ChanSigner: ChannelKeys> ChannelMonitor<ChanSigner> {
20402040
self.last_block_hash = block_hash;
20412041
}
20422042

2043-
fn would_broadcast_at_height<L: Deref>(&self, height: u32, logger: &L) -> bool where L::Target: Logger {
2043+
pub(crate) fn would_broadcast_at_height<L: Deref>(&self, height: u32, logger: &L) -> bool where L::Target: Logger {
20442044
// We need to consider all HTLCs which are:
20452045
// * in any unrevoked remote commitment transaction, as they could broadcast said
20462046
// transactions and we'd end up in a race, or
@@ -2615,9 +2615,9 @@ mod tests {
26152615
use bitcoin::hashes::hex::FromHex;
26162616
use bitcoin::hash_types::Txid;
26172617
use hex;
2618+
use chain::channelmonitor::ChannelMonitor;
26182619
use chain::transaction::OutPoint;
26192620
use ln::channelmanager::{PaymentPreimage, PaymentHash};
2620-
use ln::channelmonitor::ChannelMonitor;
26212621
use ln::onchaintx::{OnchainTxHandler, InputDescriptors};
26222622
use ln::chan_utils;
26232623
use ln::chan_utils::{HTLCOutputInCommitment, LocalCommitmentTransaction};

lightning/src/chain/mod.rs

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -13,11 +13,12 @@ use bitcoin::blockdata::script::Script;
1313
use bitcoin::blockdata::transaction::TxOut;
1414
use bitcoin::hash_types::{BlockHash, Txid};
1515

16+
use chain::channelmonitor::{ChannelMonitor, ChannelMonitorUpdate, ChannelMonitorUpdateErr, MonitorEvent};
1617
use chain::keysinterface::ChannelKeys;
1718
use chain::transaction::OutPoint;
18-
use ln::channelmonitor::{ChannelMonitor, ChannelMonitorUpdate, ChannelMonitorUpdateErr, MonitorEvent};
1919

2020
pub mod chaininterface;
21+
pub mod channelmonitor;
2122
pub mod transaction;
2223
pub mod keysinterface;
2324

lightning/src/ln/chan_utils.rs

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -81,7 +81,7 @@ pub fn build_commitment_secret(commitment_seed: &[u8; 32], idx: u64) -> [u8; 32]
8181
/// Allows us to keep track of all of the revocation secrets of counterarties in just 50*32 bytes
8282
/// or so.
8383
#[derive(Clone)]
84-
pub(super) struct CounterpartyCommitmentSecrets {
84+
pub(crate) struct CounterpartyCommitmentSecrets {
8585
old_secrets: [([u8; 32], u64); 49],
8686
}
8787

@@ -97,7 +97,7 @@ impl PartialEq for CounterpartyCommitmentSecrets {
9797
}
9898

9999
impl CounterpartyCommitmentSecrets {
100-
pub(super) fn new() -> Self {
100+
pub(crate) fn new() -> Self {
101101
Self { old_secrets: [([0; 32], 1 << 48); 49], }
102102
}
103103

@@ -111,7 +111,7 @@ impl CounterpartyCommitmentSecrets {
111111
48
112112
}
113113

114-
pub(super) fn get_min_seen_secret(&self) -> u64 {
114+
pub(crate) fn get_min_seen_secret(&self) -> u64 {
115115
//TODO This can be optimized?
116116
let mut min = 1 << 48;
117117
for &(_, idx) in self.old_secrets.iter() {
@@ -123,7 +123,7 @@ impl CounterpartyCommitmentSecrets {
123123
}
124124

125125
#[inline]
126-
pub(super) fn derive_secret(secret: [u8; 32], bits: u8, idx: u64) -> [u8; 32] {
126+
fn derive_secret(secret: [u8; 32], bits: u8, idx: u64) -> [u8; 32] {
127127
let mut res: [u8; 32] = secret;
128128
for i in 0..bits {
129129
let bitpos = bits - 1 - i;
@@ -135,7 +135,7 @@ impl CounterpartyCommitmentSecrets {
135135
res
136136
}
137137

138-
pub(super) fn provide_secret(&mut self, idx: u64, secret: [u8; 32]) -> Result<(), ()> {
138+
pub(crate) fn provide_secret(&mut self, idx: u64, secret: [u8; 32]) -> Result<(), ()> {
139139
let pos = Self::place_secret(idx);
140140
for i in 0..pos {
141141
let (old_secret, old_idx) = self.old_secrets[i as usize];
@@ -151,7 +151,7 @@ impl CounterpartyCommitmentSecrets {
151151
}
152152

153153
/// Can only fail if idx is < get_min_seen_secret
154-
pub(super) fn get_secret(&self, idx: u64) -> Option<[u8; 32]> {
154+
pub(crate) fn get_secret(&self, idx: u64) -> Option<[u8; 32]> {
155155
for i in 0..self.old_secrets.len() {
156156
if (idx & (!((1 << i) - 1))) == self.old_secrets[i].1 {
157157
return Some(Self::derive_secret(self.old_secrets[i].0, i as u8, idx))

lightning/src/ln/chanmon_update_fail_tests.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -12,9 +12,9 @@
1212
//! There are a bunch of these as their handling is relatively error-prone so they are split out
1313
//! here. See also the chanmon_fail_consistency fuzz test.
1414
15+
use chain::channelmonitor::ChannelMonitorUpdateErr;
1516
use chain::transaction::OutPoint;
1617
use ln::channelmanager::{RAACommitmentOrder, PaymentPreimage, PaymentHash, PaymentSecret, PaymentSendFailure};
17-
use ln::channelmonitor::ChannelMonitorUpdateErr;
1818
use ln::features::InitFeatures;
1919
use ln::msgs;
2020
use ln::msgs::{ChannelMessageHandler, ErrorAction, RoutingMessageHandler};

lightning/src/ln/channel.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -26,11 +26,11 @@ use bitcoin::secp256k1;
2626
use ln::features::{ChannelFeatures, InitFeatures};
2727
use ln::msgs;
2828
use ln::msgs::{DecodeError, OptionalField, DataLossProtect};
29-
use ln::channelmonitor::{ChannelMonitor, ChannelMonitorUpdate, ChannelMonitorUpdateStep, HTLC_FAIL_BACK_BUFFER};
3029
use ln::channelmanager::{PendingHTLCStatus, HTLCSource, HTLCFailReason, HTLCFailureMsg, PendingHTLCInfo, RAACommitmentOrder, PaymentPreimage, PaymentHash, BREAKDOWN_TIMEOUT, MAX_LOCAL_BREAKDOWN_TIMEOUT};
3130
use ln::chan_utils::{CounterpartyCommitmentSecrets, LocalCommitmentTransaction, TxCreationKeys, HTLCOutputInCommitment, HTLC_SUCCESS_TX_WEIGHT, HTLC_TIMEOUT_TX_WEIGHT, make_funding_redeemscript, ChannelPublicKeys, PreCalculatedTxCreationKeys};
3231
use ln::chan_utils;
3332
use chain::chaininterface::{FeeEstimator,ConfirmationTarget};
33+
use chain::channelmonitor::{ChannelMonitor, ChannelMonitorUpdate, ChannelMonitorUpdateStep, HTLC_FAIL_BACK_BUFFER};
3434
use chain::transaction::OutPoint;
3535
use chain::keysinterface::{ChannelKeys, KeysInterface};
3636
use util::transaction_utils;

lightning/src/ln/channelmanager.rs

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -38,9 +38,9 @@ use bitcoin::secp256k1;
3838
use chain;
3939
use chain::Watch;
4040
use chain::chaininterface::{BroadcasterInterface, FeeEstimator};
41+
use chain::channelmonitor::{ChannelMonitor, ChannelMonitorUpdate, ChannelMonitorUpdateErr, HTLC_FAIL_BACK_BUFFER, CLTV_CLAIM_BUFFER, LATENCY_GRACE_PERIOD_BLOCKS, ANTI_REORG_DELAY, MonitorEvent};
4142
use chain::transaction::OutPoint;
4243
use ln::channel::{Channel, ChannelError};
43-
use ln::channelmonitor::{ChannelMonitor, ChannelMonitorUpdate, ChannelMonitorUpdateErr, HTLC_FAIL_BACK_BUFFER, CLTV_CLAIM_BUFFER, LATENCY_GRACE_PERIOD_BLOCKS, ANTI_REORG_DELAY, MonitorEvent};
4444
use ln::features::{InitFeatures, NodeFeatures};
4545
use routing::router::{Route, RouteHop};
4646
use ln::msgs;
@@ -131,7 +131,7 @@ pub(super) enum HTLCForwardInfo {
131131

132132
/// Tracks the inbound corresponding to an outbound HTLC
133133
#[derive(Clone, PartialEq)]
134-
pub(super) struct HTLCPreviousHopData {
134+
pub(crate) struct HTLCPreviousHopData {
135135
short_channel_id: u64,
136136
htlc_id: u64,
137137
incoming_packet_shared_secret: [u8; 32],
@@ -150,7 +150,7 @@ struct ClaimableHTLC {
150150

151151
/// Tracks the inbound corresponding to an outbound HTLC
152152
#[derive(Clone, PartialEq)]
153-
pub(super) enum HTLCSource {
153+
pub(crate) enum HTLCSource {
154154
PreviousHopData(HTLCPreviousHopData),
155155
OutboundRoute {
156156
path: Vec<RouteHop>,

lightning/src/ln/functional_test_utils.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -11,9 +11,9 @@
1111
//! nodes for functional tests.
1212
1313
use chain::Watch;
14+
use chain::channelmonitor::ChannelMonitor;
1415
use chain::transaction::OutPoint;
1516
use ln::channelmanager::{ChannelManager, ChannelManagerReadArgs, RAACommitmentOrder, PaymentPreimage, PaymentHash, PaymentSecret, PaymentSendFailure};
16-
use ln::channelmonitor::ChannelMonitor;
1717
use routing::router::{Route, get_route};
1818
use routing::network_graph::{NetGraphMsgHandler, NetworkGraph};
1919
use ln::features::InitFeatures;

lightning/src/ln/functional_tests.rs

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -12,12 +12,12 @@
1212
//! claim outputs on-chain.
1313
1414
use chain::Watch;
15+
use chain::channelmonitor;
16+
use chain::channelmonitor::{ChannelMonitor, CLTV_CLAIM_BUFFER, LATENCY_GRACE_PERIOD_BLOCKS, ANTI_REORG_DELAY};
1517
use chain::transaction::OutPoint;
1618
use chain::keysinterface::{ChannelKeys, KeysInterface, SpendableOutputDescriptor};
1719
use ln::channel::{COMMITMENT_TX_BASE_WEIGHT, COMMITMENT_TX_WEIGHT_PER_HTLC};
1820
use ln::channelmanager::{ChannelManager,ChannelManagerReadArgs,HTLCForwardInfo,RAACommitmentOrder, PaymentPreimage, PaymentHash, PaymentSecret, PaymentSendFailure, BREAKDOWN_TIMEOUT};
19-
use ln::channelmonitor::{ChannelMonitor, CLTV_CLAIM_BUFFER, LATENCY_GRACE_PERIOD_BLOCKS, ANTI_REORG_DELAY};
20-
use ln::channelmonitor;
2121
use ln::channel::{Channel, ChannelError};
2222
use ln::{chan_utils, onion_utils};
2323
use routing::router::{Route, RouteHop, get_route};

lightning/src/ln/mod.rs

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -19,7 +19,6 @@
1919
//! call into your NetGraphMsgHandler.
2020
2121
pub mod channelmanager;
22-
pub mod channelmonitor;
2322
pub mod msgs;
2423
pub mod peer_handler;
2524
pub mod chan_utils;

0 commit comments

Comments
 (0)