Skip to content

Commit

Permalink
Blacklist all peers from before 0.3.3
Browse files Browse the repository at this point in the history
  • Loading branch information
markkacom committed Dec 19, 2014
1 parent b6bbc32 commit 58f0da7
Show file tree
Hide file tree
Showing 6 changed files with 20 additions and 4 deletions.
2 changes: 1 addition & 1 deletion README.txt
Expand Up @@ -11,7 +11,7 @@ FIM is different from NXT in the following ways:

This README is based of the original NXT README.

This is FIM version 0.3.2 which is based on NXT 1.2.6.
This is FIM version 0.3.3 which is based on NXT 1.2.6.


Running the FIM software:
Expand Down
7 changes: 7 additions & 0 deletions changelogs-fim/fim-0.3.3.changelog.txt
@@ -0,0 +1,7 @@
FIMK 0.3.3 is based on NXT 1.2.6.

Temporarily blocked all transactions from acccounts with confirmed stolen funds
after a major theft of 57M FIMK

This release and all future releases blacklist any peer that is on or below
version 0.3.2.
2 changes: 1 addition & 1 deletion src/java/nxt/Nxt.java
Expand Up @@ -20,7 +20,7 @@ public final class Nxt {
public static final String APPLICATION = "FIMK";

/* XXX - This tracks the FIM version */
public static final String VERSION = "0.3.2";
public static final String VERSION = "0.3.3";

private static final Properties defaultProperties = new Properties();
static {
Expand Down
2 changes: 1 addition & 1 deletion src/java/nxt/TransactionImpl.java
Expand Up @@ -761,7 +761,7 @@ public void validateAttachment() throws NxtException.ValidationException {
}

/* Throws NxtException.NotValidException if senderPublicKey is on locked list */
Locked.test(Nxt.getBlockchain().getHeight(), senderPublicKey);
Locked.test(Nxt.getBlockchain().getHeight(), senderPublicKey);
}

// returns false iff double spending
Expand Down
2 changes: 1 addition & 1 deletion src/java/nxt/peer/PeerImpl.java
Expand Up @@ -205,7 +205,7 @@ public int getWeight() {

@Override
public boolean isBlacklisted() {
return blacklistingTime > 0 || Peers.knownBlacklistedPeers.contains(peerAddress);
return blacklistingTime > 0 || Peers.knownBlacklistedPeers.contains(peerAddress) || Peers.blacklistedVersion(version);
}

@Override
Expand Down
9 changes: 9 additions & 0 deletions src/java/nxt/peer/Peers.java
Expand Up @@ -52,6 +52,8 @@ public static enum Event {
ADDED_ACTIVE_PEER, CHANGED_ACTIVE_PEER,
NEW_PEER
}

static final String VERSION_0_3_3 = "0.3.3";

static final int LOGGING_MASK_EXCEPTIONS = 1;
static final int LOGGING_MASK_NON200_RESPONSES = 2;
Expand Down Expand Up @@ -715,4 +717,11 @@ private static int getNumberOfConnectedPublicPeers() {

private Peers() {} // never

public static boolean blacklistedVersion(String version) {
if (version != null && VERSION_0_3_3.equals(version)) {
return false;
}
return true;
}

}

0 comments on commit 58f0da7

Please sign in to comment.