From ceda402e7882a8827038004800d29116186dc1f7 Mon Sep 17 00:00:00 2001 From: Heiko Bornholdt Date: Sun, 6 Feb 2022 17:28:10 +0100 Subject: [PATCH 1/2] merge HopCount and getArmed into a one byte flags field --- .../handler/remote/protocol/HopCount.java | 2 +- .../handler/remote/protocol/PublicHeader.java | 24 +++++++++++++------ .../handler/remote/protocol/HopCountTest.java | 6 ++--- 3 files changed, 21 insertions(+), 11 deletions(-) diff --git a/drasyl-core/src/main/java/org/drasyl/handler/remote/protocol/HopCount.java b/drasyl-core/src/main/java/org/drasyl/handler/remote/protocol/HopCount.java index 49b192c81..0763c1f46 100644 --- a/drasyl-core/src/main/java/org/drasyl/handler/remote/protocol/HopCount.java +++ b/drasyl-core/src/main/java/org/drasyl/handler/remote/protocol/HopCount.java @@ -29,7 +29,7 @@ import java.util.Objects; @SuppressWarnings("java:S2974") public class HopCount implements Comparable { public static final byte MIN_HOP_COUNT = 0; - public static final byte MAX_HOP_COUNT = 127; + public static final byte MAX_HOP_COUNT = 7; private final byte value; private HopCount(final byte value) { diff --git a/drasyl-core/src/main/java/org/drasyl/handler/remote/protocol/PublicHeader.java b/drasyl-core/src/main/java/org/drasyl/handler/remote/protocol/PublicHeader.java index fbf0dfa27..81145a6ff 100644 --- a/drasyl-core/src/main/java/org/drasyl/handler/remote/protocol/PublicHeader.java +++ b/drasyl-core/src/main/java/org/drasyl/handler/remote/protocol/PublicHeader.java @@ -34,8 +34,7 @@ import org.drasyl.identity.ProofOfWork; * This class models the public header of a drasyl protocol message. The header is structured as * follows: *