lunar-mining 2 лет назад
Родитель
Сommit
491ad0a318

+ 2 - 0
bin/lilith/src/main.rs

@@ -231,6 +231,8 @@ impl Lilith {
 
                                     // Sort whitelist by last_seen.
                                     whitelist.sort_unstable_by_key(|entry| entry.1);
+
+                                    debug!(target: "lilith", "Sorted whitelist: {:?}", whitelist)
                                 }
                                 Err(e) => {
                                     debug!(target: "lilith", "Handshake failure! {}", e);

+ 5 - 1
src/net/hosts.rs

@@ -197,6 +197,8 @@ impl Hosts {
 
             // Sort the list by last_seen.
             greylist.sort_unstable_by_key(|entry| entry.1);
+            
+            debug!(target: "net::hosts::greylist_store()", "Sorted greylist: {:?}", greylist)
         }
 
         self.store_subscriber.notify(filtered_addrs_len).await;
@@ -220,7 +222,9 @@ impl Hosts {
 
         // Sort the list by last_seen.
         whitelist.sort_unstable_by_key(|entry| entry.1);
-        debug!(target: "net::hosts::whitelist_store()", "hosts::greylist_store() [END]");
+        
+        debug!(target: "net::hosts::whitelistt_store()", "Sorted whitelist: {:?}", whitelist);
+        debug!(target: "net::hosts::whitelist_store()", "hosts::whitelist_store() [END]");
     }
 
     // Update the last_seen field of a peer on the whitelist.

+ 1 - 0
src/net/protocol/protocol_seed.rs

@@ -70,6 +70,7 @@ impl ProtocolSeed {
 
         // We set last_seen to now. TODO: ponder this a bit more. We're just reading external addrs
         // from settings- that doesn't mean they will be reachable.
+        // Perhaps this should just send a standard Addr...
         let mut addrs = vec![];
         for addr in self.settings.external_addrs.clone() {
             let last_seen = UNIX_EPOCH.elapsed().unwrap().as_secs();

+ 2 - 0
src/net/session/outbound_session.rs

@@ -648,6 +648,8 @@ impl GreylistRefinery {
                                 // Sort whitelist by last_seen.
                                 whitelist.sort_unstable_by_key(|entry| entry.1);
 
+                                debug!(target: "net::greylist_refinery::run()", "Sorted whitelist: {:?}", whitelist);
+
                                 // Remove whitelisted peer from the greylist.
                                 debug!(target: "net::greylist_refinery::run()", "Removing whitelisted peer {} from greylist", url);
                                 greylist.remove(position);

+ 1 - 1
src/net/session/seedsync_session.rs

@@ -116,7 +116,7 @@ impl SeedSyncSession {
 
         // Seed process complete
         if self.p2p().hosts().is_empty_greylist().await {
-            warn!(target: "net::session::seedsync_session", "[P2P] Hosts pool empty after seeding");
+            warn!(target: "net::session::seedsync_session", "[P2P] Greylist empty after seeding");
         }
 
         debug!(target: "net::session::seedsync_session", "SeedSyncSession::start() [END]");