Skip to content
Permalink
Browse files

Version 544. Corrected sentinel issue.

  • Loading branch information...
n-y-z-o committed Sep 5, 2019
1 parent 26098c3 commit 9e66c00c98ce75b0df4b565ecbd163e65caef57a
Showing with 6 additions and 12 deletions.
  1. +5 −11 src/main/java/co/nyzo/verifier/Message.java
  2. +1 −1 src/main/java/co/nyzo/verifier/Version.java
@@ -25,9 +25,8 @@

private static final long maximumMessageLength = 4194304; // 4 MB
private static final Set<ByteBuffer> whitelist = ConcurrentHashMap.newKeySet();
private static final Set<MessageType> disallowedNonCycleTypes = new HashSet<>(Arrays.asList(MessageType.NewBlock9,
MessageType.BlockVote19, MessageType.NewVerifierVote21, MessageType.MissingBlockVoteRequest23,
MessageType.MissingBlockRequest25));
private static final Set<MessageType> disallowedNonCycleTypes = new HashSet<>(Arrays.asList(MessageType.BlockVote19,
MessageType.NewVerifierVote21, MessageType.MissingBlockVoteRequest23, MessageType.MissingBlockRequest25));
private static final Set<MessageType> udpTypes = new HashSet<>(Arrays.asList(MessageType.BlockVote19,
MessageType.NewVerifierVote21));
public static final long replayProtectionInterval = 5000L;
@@ -183,14 +182,9 @@ public static void fetch(Node node, Message message, MessageCallback messageCall

public static void fetchTcp(String hostNameOrIp, int port, Message message, MessageCallback messageCallback) {

byte[] identifier = NodeManager.identifierForIpAddress(hostNameOrIp);

// Do not send the message to this verifier, and do not send a message that will get this verifier blacklisted
// if it is not in the cycle.
if (!ByteUtil.arraysAreEqual(identifier, Verifier.getIdentifier()) &&
(BlockManager.verifierInOrNearCurrentCycle(ByteBuffer.wrap(Verifier.getIdentifier())) ||
BlockManager.inGenesisCycle() ||
!disallowedNonCycleTypes.contains(message.getType()))) {
// Do not send a message that will get this IP blacklisted.
if (BlockManager.verifierInOrNearCurrentCycle(ByteBuffer.wrap(message.getSourceNodeIdentifier())) ||
BlockManager.inGenesisCycle() || !disallowedNonCycleTypes.contains(message.getType())) {

new Thread(new Runnable() {
@Override
@@ -2,7 +2,7 @@

public class Version {

private static final int version = 543;
private static final int version = 544;

public static int getVersion() {

0 comments on commit 9e66c00

Please sign in to comment.
You can’t perform that action at this time.