Make Channel non-public except in fuzztarget mode, bump version

This commit is contained in:
Matt Corallo 2018-03-27 11:18:10 -04:00
parent cf6308a5ae
commit 187ca8c0c8
3 changed files with 9 additions and 5 deletions

View file

@ -1,6 +1,6 @@
[package] [package]
name = "lightning" name = "lightning"
version = "0.0.1" version = "0.0.2"
authors = ["Matt Corallo"] authors = ["Matt Corallo"]
license = "Apache-2.0" license = "Apache-2.0"
repository = "https://github.com/TheBlueMatt/rust-lightning/" repository = "https://github.com/TheBlueMatt/rust-lightning/"

View file

@ -41,8 +41,8 @@ pub struct PendingForwardHTLCInfo {
amt_to_forward: u64, amt_to_forward: u64,
outgoing_cltv_value: u32, 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 { impl PendingForwardHTLCInfo {
pub fn dummy() -> Self { pub fn dummy() -> Self {
Self { Self {
@ -635,7 +635,7 @@ impl ChannelManager {
let mut channel_state_lock = self.channel_state.lock().unwrap(); let mut channel_state_lock = self.channel_state.lock().unwrap();
let channel_state = channel_state_lock.borrow_parts(); 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; return;
} }

View file

@ -1,9 +1,13 @@
pub mod channelmanager; pub mod channelmanager;
pub mod channel;
pub mod channelmonitor; pub mod channelmonitor;
pub mod msgs; pub mod msgs;
pub mod router; pub mod router;
pub mod peer_channel_encryptor; pub mod peer_channel_encryptor;
pub mod peer_handler; pub mod peer_handler;
#[cfg(feature = "fuzztarget")]
pub mod channel;
#[cfg(not(feature = "fuzztarget"))]
pub(crate) mod channel;
mod chan_utils; mod chan_utils;