Make Channel non-public except in fuzztarget mode, bump version 2017-04-channel-close
authorMatt Corallo <git@bluematt.me>
Tue, 27 Mar 2018 15:18:10 +0000 (11:18 -0400)
committerMatt Corallo <git@bluematt.me>
Mon, 2 Apr 2018 22:07:03 +0000 (18:07 -0400)
Cargo.toml
src/ln/channelmanager.rs
src/ln/mod.rs

index 3e07441c17ef38070c0877e347c4033fa1f35bd4..8e1946b1ec8e2abfdb2be5c8bd14b6e90b09bb76 100644 (file)
@@ -1,6 +1,6 @@
 [package]
 name = "lightning"
-version = "0.0.1"
+version = "0.0.2"
 authors = ["Matt Corallo"]
 license = "Apache-2.0"
 repository = "https://github.com/TheBlueMatt/rust-lightning/"
index 8be2348a7e1e5374ba82bc063a3c7ac25a668bb8..ff78a27df58b3243979758af8ba8889e36b63e01 100644 (file)
@@ -41,8 +41,8 @@ pub struct PendingForwardHTLCInfo {
        amt_to_forward: u64,
        outgoing_cltv_value: u32,
 }
-//TODO: This is public, and needed to call Channel::update_add_htlc, so there needs to be a way to
-//initialize it usefully...probably make it optional in Channel instead).
+
+#[cfg(feature = "fuzztarget")]
 impl PendingForwardHTLCInfo {
        pub fn dummy() -> Self {
                Self {
@@ -635,7 +635,7 @@ impl ChannelManager {
                        let mut channel_state_lock = self.channel_state.lock().unwrap();
                        let channel_state = channel_state_lock.borrow_parts();
 
-                       if Instant::now() < *channel_state.next_forward {
+                       if cfg!(not(feature = "fuzztarget")) && Instant::now() < *channel_state.next_forward {
                                return;
                        }
 
index 1f5fa460afbf7d71972da1b7ba3283b1d5e41340..7cd4272e13c1013e5e4abe1d38380aa0bd4e76dd 100644 (file)
@@ -1,9 +1,13 @@
 pub mod channelmanager;
-pub mod channel;
 pub mod channelmonitor;
 pub mod msgs;
 pub mod router;
 pub mod peer_channel_encryptor;
 pub mod peer_handler;
 
+#[cfg(feature = "fuzztarget")]
+pub mod channel;
+#[cfg(not(feature = "fuzztarget"))]
+pub(crate) mod channel;
+
 mod chan_utils;