Skip to content

Commit 1755492

Browse files
Expose onion message module as public
And fix some warnings
1 parent e9b3293 commit 1755492

File tree

4 files changed

+3
-7
lines changed

4 files changed

+3
-7
lines changed

lightning/src/lib.rs

+1-2
Original file line numberDiff line numberDiff line change
@@ -76,8 +76,7 @@ pub mod util;
7676
pub mod chain;
7777
pub mod ln;
7878
pub mod routing;
79-
#[allow(unused)]
80-
mod onion_message; // To be exposed after sending/receiving OMs is supported in PeerManager.
79+
pub mod onion_message;
8180

8281
#[cfg(feature = "std")]
8382
/// Re-export of either `core2::io` or `std::io`, depending on the `std` feature flag.

lightning/src/onion_message/blinded_route.rs

-1
Original file line numberDiff line numberDiff line change
@@ -16,7 +16,6 @@ use super::utils;
1616
use util::chacha20poly1305rfc::ChaChaPolyWriteAdapter;
1717
use util::ser::{VecWriter, Writeable, Writer};
1818

19-
use core::iter::FromIterator;
2019
use io;
2120
use prelude::*;
2221

lightning/src/onion_message/messenger.rs

+1-3
Original file line numberDiff line numberDiff line change
@@ -35,9 +35,7 @@ use prelude::*;
3535
///
3636
/// # Example
3737
///
38-
// Needs to be `ignore` until the `onion_message` module is made public, otherwise this is a test
39-
// failure.
40-
/// ```ignore
38+
/// ```
4139
/// # extern crate bitcoin;
4240
/// # use bitcoin::hashes::_export::_core::time::Duration;
4341
/// # use bitcoin::secp256k1::{PublicKey, Secp256k1, SecretKey};

lightning/src/onion_message/packet.rs

+1-1
Original file line numberDiff line numberDiff line change
@@ -74,7 +74,7 @@ impl LengthReadable for Packet {
7474
while read_idx < hop_data_len {
7575
let mut read_buffer = [0; READ_BUFFER_SIZE];
7676
let read_amt = cmp::min(hop_data_len - read_idx, READ_BUFFER_SIZE);
77-
r.read_exact(&mut read_buffer[..read_amt]);
77+
r.read_exact(&mut read_buffer[..read_amt])?;
7878
hop_data.extend_from_slice(&read_buffer[..read_amt]);
7979
read_idx += read_amt;
8080
}

0 commit comments

Comments
 (0)