3
0
mirror of https://github.com/Qortal/altcoinj.git synced 2025-02-12 10:15:52 +00:00

Move min version for NotFoundMessage to a static member of that class.

This commit is contained in:
Mike Hearn 2014-01-30 17:18:30 +01:00
parent 7c9651a801
commit 9204c13233
2 changed files with 5 additions and 4 deletions

View File

@ -24,6 +24,8 @@ import java.util.List;
* as an inventory message and lists the hashes of the missing items. * as an inventory message and lists the hashes of the missing items.
*/ */
public class NotFoundMessage extends InventoryMessage { public class NotFoundMessage extends InventoryMessage {
public static int MIN_PROTOCOL_VERSION = 70001;
public NotFoundMessage(NetworkParameters params) { public NotFoundMessage(NetworkParameters params) {
super(params); super(params);
} }
@ -32,8 +34,8 @@ public class NotFoundMessage extends InventoryMessage {
super(params, payloadBytes); super(params, payloadBytes);
} }
public NotFoundMessage(NetworkParameters unitTestParams, List<InventoryItem> items) { public NotFoundMessage(NetworkParameters params, List<InventoryItem> items) {
super(unitTestParams); super(params);
this.items = new ArrayList<InventoryItem>(items); this.items = new ArrayList<InventoryItem>(items);
} }
} }

View File

@ -32,7 +32,6 @@ import org.slf4j.Logger;
import org.slf4j.LoggerFactory; import org.slf4j.LoggerFactory;
import javax.annotation.Nullable; import javax.annotation.Nullable;
import java.net.InetSocketAddress;
import java.util.*; import java.util.*;
import java.util.concurrent.CopyOnWriteArrayList; import java.util.concurrent.CopyOnWriteArrayList;
import java.util.concurrent.CopyOnWriteArraySet; import java.util.concurrent.CopyOnWriteArraySet;
@ -1382,7 +1381,7 @@ public class Peer extends PeerSocketHandler {
} }
private boolean isNotFoundMessageSupported() { private boolean isNotFoundMessageSupported() {
return vPeerVersionMessage.clientVersion >= 70001; return vPeerVersionMessage.clientVersion >= NotFoundMessage.MIN_PROTOCOL_VERSION;
} }
/** /**