X-Git-Url: http://git.bitcoin.ninja/index.cgi?a=blobdiff_plain;f=lightning-net-tokio%2Fsrc%2Flib.rs;h=6d001ca67fd5e1ec44d0307a198509d83cf2538a;hb=19dae8b19332b90420e5c3bf5643d72e2febdb74;hp=d02f23fdd2cfd8649e9238cdda5a8fba470ace5c;hpb=12c2086d58b54e7d2b1356a3a45d3a605dcd2972;p=rust-lightning diff --git a/lightning-net-tokio/src/lib.rs b/lightning-net-tokio/src/lib.rs index d02f23fd..6d001ca6 100644 --- a/lightning-net-tokio/src/lib.rs +++ b/lightning-net-tokio/src/lib.rs @@ -22,9 +22,8 @@ //! //! [`PeerManager`]: lightning::ln::peer_handler::PeerManager -// Prefix these with `rustdoc::` when we update our MSRV to be >= 1.52 to remove warnings. -#![deny(broken_intra_doc_links)] -#![deny(private_intra_doc_links)] +#![deny(rustdoc::broken_intra_doc_links)] +#![deny(rustdoc::private_intra_doc_links)] #![deny(missing_docs)] #![cfg_attr(docsrs, feature(doc_auto_cfg))] @@ -209,7 +208,12 @@ impl Connection { break Disconnect::CloseConnection; } }, - SelectorOutput::B(_) => {}, + SelectorOutput::B(some) => { + // The mpsc Receiver should only return `None` if the write side has been + // dropped, but that shouldn't be possible since its referenced by the Self in + // `us`. + debug_assert!(some.is_some()); + }, SelectorOutput::C(res) => { if res.is_err() { break Disconnect::PeerDisconnected; } match reader.try_read(&mut buf) { @@ -503,6 +507,9 @@ impl peer_handler::SocketDescriptor for SocketDescriptor { written_len += res; if written_len == data.len() { return written_len; } }, + Err(ref e) if e.kind() == std::io::ErrorKind::WouldBlock => { + continue; + } Err(_) => return written_len, } }, @@ -554,7 +561,6 @@ mod tests { use lightning::ln::features::*; use lightning::ln::msgs::*; use lightning::ln::peer_handler::{MessageHandler, PeerManager}; - use lightning::ln::features::NodeFeatures; use lightning::routing::gossip::NodeId; use lightning::events::*; use lightning::util::test_utils::TestNodeSigner; @@ -618,8 +624,11 @@ mod tests { fn handle_open_channel_v2(&self, _their_node_id: &PublicKey, _msg: &OpenChannelV2) {} fn handle_accept_channel_v2(&self, _their_node_id: &PublicKey, _msg: &AcceptChannelV2) {} fn handle_stfu(&self, _their_node_id: &PublicKey, _msg: &Stfu) {} + #[cfg(splicing)] fn handle_splice(&self, _their_node_id: &PublicKey, _msg: &Splice) {} + #[cfg(splicing)] fn handle_splice_ack(&self, _their_node_id: &PublicKey, _msg: &SpliceAck) {} + #[cfg(splicing)] fn handle_splice_locked(&self, _their_node_id: &PublicKey, _msg: &SpliceLocked) {} fn handle_tx_add_input(&self, _their_node_id: &PublicKey, _msg: &TxAddInput) {} fn handle_tx_add_output(&self, _their_node_id: &PublicKey, _msg: &TxAddOutput) {}