mirror of
https://github.com/Qortal/altcoinj.git
synced 2025-02-14 19:25:51 +00:00
Don't use peers that claim to have a block chain and then report a height of zero. These are probably buggy reimplementations of the protocol.
This commit is contained in:
parent
c41b6d74fa
commit
3d5a7ea7ec
@ -25,7 +25,6 @@ import java.io.OutputStream;
|
|||||||
import java.net.InetAddress;
|
import java.net.InetAddress;
|
||||||
import java.net.InetSocketAddress;
|
import java.net.InetSocketAddress;
|
||||||
import java.net.Socket;
|
import java.net.Socket;
|
||||||
import java.net.SocketException;
|
|
||||||
import java.util.Date;
|
import java.util.Date;
|
||||||
import java.util.LinkedHashMap;
|
import java.util.LinkedHashMap;
|
||||||
|
|
||||||
@ -120,8 +119,10 @@ public class TCPNetworkConnection implements NetworkConnection {
|
|||||||
versionMessage.bestHeight
|
versionMessage.bestHeight
|
||||||
});
|
});
|
||||||
// BitCoinJ is a client mode implementation. That means there's not much point in us talking to other client
|
// BitCoinJ is a client mode implementation. That means there's not much point in us talking to other client
|
||||||
// mode nodes because we can't download the data from them we need to find/verify transactions.
|
// mode nodes because we can't download the data from them we need to find/verify transactions. Some bogus
|
||||||
if (!versionMessage.hasBlockChain()) {
|
// implementations claim to have a block chain in their services field but then report a height of zero, filter
|
||||||
|
// them out here.
|
||||||
|
if (!versionMessage.hasBlockChain() || versionMessage.bestHeight <= 0) {
|
||||||
// Shut down the socket
|
// Shut down the socket
|
||||||
try {
|
try {
|
||||||
shutdown();
|
shutdown();
|
||||||
|
Loading…
x
Reference in New Issue
Block a user