From a2eee5a6738966357b72ca4d33fb9251a4930fbe Mon Sep 17 00:00:00 2001
From: zzz <zzz@i2pmail.org>
Date: Tue, 6 Sep 2022 11:56:33 -0400
Subject: [PATCH] NetDB: Fix reseeding when clock is skewed

reported, fixed, and tested by zlatinb
---
 history.txt                                                   | 4 ++++
 router/java/src/net/i2p/router/RouterVersion.java             | 2 +-
 .../i2p/router/networkdb/kademlia/PersistentDataStore.java    | 2 +-
 3 files changed, 6 insertions(+), 2 deletions(-)

diff --git a/history.txt b/history.txt
index 93e72a3bae..edac48c296 100644
--- a/history.txt
+++ b/history.txt
@@ -1,3 +1,7 @@
+2022-09-06 zzz
+ * NetDB: Fix reseeding when clock is skewed
+ * SSU2: Don't publish or connect if our MTU becomes too small
+
 2022-09-04 zzz
  * SusiDNS: Fix adding to empty address book
 
diff --git a/router/java/src/net/i2p/router/RouterVersion.java b/router/java/src/net/i2p/router/RouterVersion.java
index f2424bd3b2..707cdcd348 100644
--- a/router/java/src/net/i2p/router/RouterVersion.java
+++ b/router/java/src/net/i2p/router/RouterVersion.java
@@ -18,7 +18,7 @@ public class RouterVersion {
     /** deprecated */
     public final static String ID = "Git";
     public final static String VERSION = CoreVersion.VERSION;
-    public final static long BUILD = 6;
+    public final static long BUILD = 7;
 
     /** for example "-test" */
     public final static String EXTRA = "";
diff --git a/router/java/src/net/i2p/router/networkdb/kademlia/PersistentDataStore.java b/router/java/src/net/i2p/router/networkdb/kademlia/PersistentDataStore.java
index 6a57e83ffd..9e47f55b30 100644
--- a/router/java/src/net/i2p/router/networkdb/kademlia/PersistentDataStore.java
+++ b/router/java/src/net/i2p/router/networkdb/kademlia/PersistentDataStore.java
@@ -366,7 +366,7 @@ public class PersistentDataStore extends TransientDataStore {
                 requeue(READ_DELAY);
                 return;
             }
-            long now = getContext().clock().now();
+            long now = System.currentTimeMillis();
             // check directory mod time to save a lot of object churn in scanning all the file names
             long lastMod = _dbDir.lastModified();
             // if size() (= RI + LS) is too low, call anyway to check for reseed
-- 
GitLab