From 118b90315bca6aa45d91b1e92d7013d1d8c940ee Mon Sep 17 00:00:00 2001 From: idk Date: Mon, 3 Jul 2023 14:22:00 -0400 Subject: [PATCH] Add multihome flag --- core/java/src/net/i2p/data/DatabaseEntry.java | 9 +++++++++ .../kademlia/HandleFloodfillDatabaseStoreMessageJob.java | 1 + 2 files changed, 10 insertions(+) diff --git a/core/java/src/net/i2p/data/DatabaseEntry.java b/core/java/src/net/i2p/data/DatabaseEntry.java index 0578f17af3..4557fb7790 100644 --- a/core/java/src/net/i2p/data/DatabaseEntry.java +++ b/core/java/src/net/i2p/data/DatabaseEntry.java @@ -64,6 +64,7 @@ public abstract class DatabaseEntry extends DataStructureImpl { private long _routingKeyGenMod; protected boolean _receivedAsPublished; protected boolean _receivedAsReply; + protected boolean _possibleMultihome; /** * A common interface to the timestamp of the two subclasses. @@ -296,4 +297,12 @@ public boolean getReceivedAsReply() { public void setReceivedAsReply() { _receivedAsReply = true; } + + public void setMultihome() { + _possibleMultihome = true; + } + + public boolean getMultihome() { + return _possibleMultihome; + } } diff --git a/router/java/src/net/i2p/router/networkdb/kademlia/HandleFloodfillDatabaseStoreMessageJob.java b/router/java/src/net/i2p/router/networkdb/kademlia/HandleFloodfillDatabaseStoreMessageJob.java index 3a299be09b..7ad5ebf202 100644 --- a/router/java/src/net/i2p/router/networkdb/kademlia/HandleFloodfillDatabaseStoreMessageJob.java +++ b/router/java/src/net/i2p/router/networkdb/kademlia/HandleFloodfillDatabaseStoreMessageJob.java @@ -103,6 +103,7 @@ public void runJob() { if (!ls.getReceivedAsReply()) ls.setReceivedAsPublished(); if (getContext().clientManager().isLocal(key)) { + ls.setMultihome(); getContext().statManager().addRateData("netDb.storeLocalLeaseSetAttempt", 1, 0); // throw rather than return, so that we send the ack below (prevent easy attack) dontBlamePeer = true;