Skip to content

Housekeeping: fix some warning and docs #2568

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 5 commits into from
Sep 14, 2023
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
11 changes: 5 additions & 6 deletions lightning-net-tokio/src/lib.rs
Original file line number Diff line number Diff line change
Expand Up @@ -31,10 +31,9 @@

use bitcoin::secp256k1::PublicKey;

use tokio::net::{tcp, TcpStream};
use tokio::{io, time};
use tokio::net::TcpStream;
use tokio::time;
use tokio::sync::mpsc;
use tokio::io::AsyncWrite;

use lightning::ln::peer_handler;
use lightning::ln::peer_handler::SocketDescriptor as LnSocketTrait;
Expand Down Expand Up @@ -231,7 +230,7 @@ impl Connection {
// readable() is allowed to spuriously wake, so we have to handle
// WouldBlock here.
},
Err(e) => break Disconnect::PeerDisconnected,
Err(_) => break Disconnect::PeerDisconnected,
}
},
}
Expand Down Expand Up @@ -493,10 +492,10 @@ impl peer_handler::SocketDescriptor for SocketDescriptor {
written_len += res;
if written_len == data.len() { return written_len; }
},
Err(e) => return written_len,
Err(_) => return written_len,
}
},
task::Poll::Ready(Err(e)) => return written_len,
task::Poll::Ready(Err(_)) => return written_len,
task::Poll::Pending => {
// We're queued up for a write event now, but we need to make sure we also
// pause read given we're now waiting on the remote end to ACK (and in
Expand Down
4 changes: 2 additions & 2 deletions lightning/src/ln/mod.rs
Original file line number Diff line number Diff line change
Expand Up @@ -13,14 +13,14 @@
#[macro_use]
pub mod functional_test_utils;

pub mod channel_id;
pub mod channelmanager;
pub mod inbound_payment;
pub mod msgs;
pub mod peer_handler;
pub mod chan_utils;
pub mod features;
pub mod script;
mod channel_id;

#[cfg(fuzzing)]
pub mod peer_channel_encryptor;
Expand All @@ -33,7 +33,7 @@ pub mod channel;
pub(crate) mod channel;

// Re-export ChannelId
pub use self::channel_id::ChannelId;
pub use channel_id::ChannelId;

pub(crate) mod onion_utils;
mod outbound_payment;
Expand Down
2 changes: 1 addition & 1 deletion lightning/src/ln/monitor_tests.rs
Original file line number Diff line number Diff line change
Expand Up @@ -2231,7 +2231,7 @@ fn test_anchors_aggregated_revoked_htlc_tx() {
assert!(nodes[1].chain_monitor.chain_monitor.get_and_clear_pending_events().is_empty());
let spendable_output_events = nodes[0].chain_monitor.chain_monitor.get_and_clear_pending_events();
assert_eq!(spendable_output_events.len(), 2);
for (idx, event) in spendable_output_events.iter().enumerate() {
for event in spendable_output_events.iter() {
if let Event::SpendableOutputs { outputs, channel_id } = event {
assert_eq!(outputs.len(), 1);
assert!(vec![chan_b.2, chan_a.2].contains(&channel_id.unwrap()));
Expand Down
2 changes: 1 addition & 1 deletion lightning/src/ln/shutdown_tests.rs
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@
use crate::sign::{EntropySource, SignerProvider};
use crate::chain::transaction::OutPoint;
use crate::events::{Event, MessageSendEvent, MessageSendEventsProvider, ClosureReason};
use crate::events::{MessageSendEvent, MessageSendEventsProvider, ClosureReason};
use crate::ln::channelmanager::{self, PaymentSendFailure, PaymentId, RecipientOnionFields, ChannelShutdownState, ChannelDetails};
use crate::routing::router::{PaymentParameters, get_route, RouteParameters};
use crate::ln::msgs;
Expand Down
2 changes: 1 addition & 1 deletion lightning/src/util/test_utils.rs
Original file line number Diff line number Diff line change
Expand Up @@ -427,7 +427,7 @@ impl<Signer: sign::WriteableEcdsaChannelSigner> chainmonitor::Persist<Signer> fo
}
}

pub(crate) struct TestStore {
pub struct TestStore {
persisted_bytes: Mutex<HashMap<String, HashMap<String, Vec<u8>>>>,
read_only: bool,
}
Expand Down