Skip to content
This repository was archived by the owner on Feb 15, 2024. It is now read-only.

Commit 6db8fa5

Browse files
committed
ncfp10-a
1 parent 7578606 commit 6db8fa5

File tree

3 files changed

+11
-4
lines changed

3 files changed

+11
-4
lines changed

src/main/java/co/nyzo/verifier/Message.java

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -212,7 +212,6 @@ public void run() {
212212
if (socket == null) {
213213
NodeManager.markFailedConnection(hostNameOrIp);
214214
} else {
215-
NodeManager.markSuccessfulConnection(hostNameOrIp);
216215

217216
try {
218217
OutputStream outputStream = socket.getOutputStream();
@@ -221,6 +220,7 @@ public void run() {
221220
socket.setSoTimeout(1000);
222221
response = readFromStream(socket.getInputStream(), socket.getInetAddress().getAddress(),
223222
message.getType());
223+
NodeManager.markSuccessfulConnection(hostNameOrIp);
224224
} catch (Exception reportOnly) {
225225
System.err.println("Exception sending message " + message.getType() + " to " +
226226
hostNameOrIp + ":" + port + ": " + PrintUtil.printException(reportOnly));

src/main/java/co/nyzo/verifier/NodeManager.java

Lines changed: 9 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -68,7 +68,12 @@ public static void updateNode(Message message) {
6868
// typically made when a node comes back online after a temporary network issue.
6969
Node node = ipAddressToNodeMap.get(ByteBuffer.wrap(message.getSourceIpAddress()));
7070
if (node != null) {
71-
node.markSuccessfulConnection();
71+
ByteBuffer identifierBuffer = ByteBuffer.wrap(node.getIdentifier());
72+
if (BlockManager.verifierInCurrentCycle(identifierBuffer)) {
73+
node.markSuccessfulConnection();
74+
} else {
75+
LogUtil.println("Missing block request from out of cycle in updateNode(): " + NicknameManager.get(node.getIdentifier()));
76+
}
7277
}
7378
} else {
7479
LogUtil.println("unrecognized message type in updateNode(): " + message.getType());
@@ -96,7 +101,9 @@ private static void updateNode(byte[] identifier, byte[] ipAddress, int portTcp,
96101
if (portUdp > 0) {
97102
existingNode.setPortUdp(portUdp);
98103
}
99-
existingNode.markSuccessfulConnection();
104+
if (isNodeJoinResponse) {
105+
existingNode.markSuccessfulConnection();
106+
}
100107
} else {
101108
// If the existing node is not null, remove it.
102109
if (existingNode != null) {

src/main/java/co/nyzo/verifier/Version.java

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@
22

33
public class Version {
44

5-
private static final int version = 595;
5+
private static final int version = 595001;
66

77
public static int getVersion() {
88

0 commit comments

Comments
 (0)