Log when a channel is closed on startup due to stale ChannelManager
[rust-lightning] / lightning / src / ln / peer_handler.rs
index 96ec31c98ee1b4aa289f2ba78ee32c76a4e5f22d..ec7500190d7ec3b062636fca716e71805ffddb05 100644 (file)
@@ -33,7 +33,7 @@ use routing::network_graph::NetGraphMsgHandler;
 use prelude::*;
 use alloc::collections::LinkedList;
 use alloc::fmt::Debug;
-use std::sync::{Arc, Mutex};
+use sync::{Arc, Mutex};
 use core::sync::atomic::{AtomicUsize, Ordering};
 use core::{cmp, hash, fmt, mem};
 use core::ops::Deref;
@@ -888,15 +888,7 @@ impl<Descriptor: SocketDescriptor, CM: Deref, RM: Deref, L: Deref> PeerManager<D
                                        return Err(PeerHandleError{ no_connection_possible: false }.into());
                                }
 
-                               log_info!(
-                                       self.logger, "Received peer Init message: data_loss_protect: {}, initial_routing_sync: {}, upfront_shutdown_script: {}, gossip_queries: {}, static_remote_key: {}, unknown flags (local and global): {}",
-                                       if msg.features.supports_data_loss_protect() { "supported" } else { "not supported"},
-                                       if msg.features.initial_routing_sync() { "requested" } else { "not requested" },
-                                       if msg.features.supports_upfront_shutdown_script() { "supported" } else { "not supported"},
-                                       if msg.features.supports_gossip_queries() { "supported" } else { "not supported" },
-                                       if msg.features.supports_static_remote_key() { "supported" } else { "not supported"},
-                                       if msg.features.supports_unknown_bits() { "present" } else { "none" }
-                               );
+                               log_info!(self.logger, "Received peer Init message: {}", msg.features);
 
                                if msg.features.initial_routing_sync() {
                                        peer.sync_status = InitSyncTracker::ChannelsSyncing(0);
@@ -1447,7 +1439,7 @@ mod tests {
        use bitcoin::secp256k1::key::{SecretKey, PublicKey};
 
        use prelude::*;
-       use std::sync::{Arc, Mutex};
+       use sync::{Arc, Mutex};
        use core::sync::atomic::Ordering;
 
        #[derive(Clone)]