Merge pull request #2568 from tnull/2023-09-housekeeping
authorMatt Corallo <649246+TheBlueMatt@users.noreply.github.com>
Thu, 14 Sep 2023 20:17:05 +0000 (20:17 +0000)
committerGitHub <noreply@github.com>
Thu, 14 Sep 2023 20:17:05 +0000 (20:17 +0000)
Housekeeping: fix some warning and docs

lightning-net-tokio/src/lib.rs
lightning/src/ln/mod.rs
lightning/src/ln/monitor_tests.rs
lightning/src/ln/shutdown_tests.rs
lightning/src/util/test_utils.rs

index 06aed3194f9bc18e27d146ea9cbedc23604edfe8..5527d85adf6f819e0b02e3ad05e18cc7c4426ae6 100644 (file)
 
 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;
@@ -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,
                                        }
                                },
                        }
@@ -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
index e03190a9d8c9e0188395ae2ade899369924e7d75..beefd2d463b3ed2b938c6f82fdabef63757adccd 100644 (file)
@@ -13,7 +13,6 @@
 #[macro_use]
 pub mod functional_test_utils;
 
-pub mod channel_id;
 pub mod channelmanager;
 pub mod inbound_payment;
 pub mod msgs;
@@ -21,6 +20,7 @@ pub mod peer_handler;
 pub mod chan_utils;
 pub mod features;
 pub mod script;
+mod channel_id;
 
 #[cfg(fuzzing)]
 pub mod peer_channel_encryptor;
@@ -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;
index 4af0f41becfc312c69f84c5eecc8a6a27575e35b..ece24794f63f593ecba133660fa73a466fc547a7 100644 (file)
@@ -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()));
index 1310d25d476a631cdd87d8268d59ac572005649f..f105edc19c05be35d1dceb1480681b35651172f7 100644 (file)
@@ -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;
index 09c99815bb70077ad19355eb7683a50a9f31526e..785b40befd472ba10b30fb618bd75eb9ab20c15a 100644 (file)
@@ -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,
 }