update geet-peers new spec requirement
This commit is contained in:
parent
5f413d0ffb
commit
e487f3475f
|
@ -24,7 +24,7 @@ public class GetPeersMessage extends P2pMessage {
|
|||
|
||||
@Override
|
||||
public Class<PeersMessage> getAnswerMessage() {
|
||||
return PeersMessage.class;
|
||||
return null;
|
||||
}
|
||||
|
||||
@Override
|
||||
|
|
|
@ -56,6 +56,7 @@ public class P2pHandler extends SimpleChannelInboundHandler<P2pMessage> {
|
|||
private boolean peerDiscoveryMode = false;
|
||||
|
||||
private HelloMessage handshakeHelloMessage = null;
|
||||
private Set<PeerInfo> lastPeersSent;
|
||||
|
||||
public P2pHandler() {
|
||||
}
|
||||
|
@ -150,14 +151,21 @@ public class P2pHandler extends SimpleChannelInboundHandler<P2pMessage> {
|
|||
}
|
||||
|
||||
private void sendPeers() {
|
||||
|
||||
Set<PeerInfo> peers = WorldManager.getInstance().getPeerDiscovery().getPeers();
|
||||
|
||||
if (lastPeersSent != null && peers.equals(lastPeersSent)){
|
||||
logger.info("No new peers discovered don't answer for GetPeers");
|
||||
return;
|
||||
}
|
||||
|
||||
Set<Peer> peerSet = new HashSet<>();
|
||||
for (PeerInfo peer : peers){
|
||||
new Peer(peer.getAddress(), peer.getPort(), peer.getPeerId());
|
||||
}
|
||||
|
||||
PeersMessage msg = new PeersMessage(peerSet);
|
||||
lastPeersSent = peers;
|
||||
msgQueue.sendMessage(msg);
|
||||
}
|
||||
|
||||
|
|
|
@ -9,8 +9,8 @@ peer.discovery.ip.list = poc-7.ethdev.com:30303,\
|
|||
185.43.109.23:30303
|
||||
|
||||
# Peer Server Zero (poc-7.ethdev.com)
|
||||
#peer.active.ip = 207.12.89.180
|
||||
#peer.active.port = 30303
|
||||
peer.active.ip = 23.22.211.45
|
||||
peer.active.port = 60606
|
||||
|
||||
|
||||
# ZeroGox
|
||||
|
@ -18,8 +18,8 @@ peer.discovery.ip.list = poc-7.ethdev.com:30303,\
|
|||
#peer.active.port = 30303
|
||||
|
||||
# Winslave
|
||||
peer.active.ip = 185.43.109.23
|
||||
peer.active.port = 30303
|
||||
#peer.active.ip = 185.43.109.23
|
||||
#peer.active.port = 30303
|
||||
|
||||
# Mist
|
||||
#peer.active.ip = 213.46.28.223
|
||||
|
@ -76,7 +76,7 @@ samples.dir = samples
|
|||
# the existing database will be
|
||||
# destroyed and all the data will be
|
||||
# downloaded from peers again
|
||||
database.reset = true
|
||||
database.reset = false
|
||||
|
||||
# place to save physical storage files
|
||||
database.dir = database
|
||||
|
|
Loading…
Reference in New Issue