Add onHandShakePeer() to EthereumListener
This commit is contained in:
parent
c89e591d9e
commit
bbb9e9e303
|
@ -15,7 +15,7 @@ public interface EthereumListener {
|
|||
public void trace(String output);
|
||||
|
||||
public void onBlock(Block block);
|
||||
|
||||
|
||||
public void onRecvMessage(Message message);
|
||||
|
||||
public void onSendMessage(Message message);
|
||||
|
@ -27,4 +27,7 @@ public interface EthereumListener {
|
|||
public void onSyncDone();
|
||||
|
||||
public void onNoConnections();
|
||||
|
||||
public void onHandShakePeer();
|
||||
|
||||
}
|
||||
|
|
|
@ -41,6 +41,11 @@ public class EthereumListenerAdapter implements EthereumListener {
|
|||
|
||||
}
|
||||
|
||||
@Override
|
||||
public void onHandShakePeer() {
|
||||
|
||||
}
|
||||
|
||||
@Override
|
||||
public void onNoConnections() {
|
||||
|
||||
|
|
|
@ -68,6 +68,12 @@ public class EthereumListenerWrapper implements EthereumListener {
|
|||
listener.onNoConnections();
|
||||
}
|
||||
|
||||
@Override
|
||||
public void onHandShakePeer() {
|
||||
if (listener != null)
|
||||
listener.onHandShakePeer();
|
||||
}
|
||||
|
||||
public void addListener(EthereumListener listener) {
|
||||
if (listener != null)
|
||||
this.listener = listener;
|
||||
|
|
|
@ -243,6 +243,7 @@ public class P2pHandler extends SimpleChannelInboundHandler<P2pMessage> {
|
|||
|
||||
//todo calculate the Offsets
|
||||
worldManager.getPeerDiscovery().getPeers().add(confirmedPeer);
|
||||
worldManager.getListener().onHandShakePeer();
|
||||
}
|
||||
}
|
||||
|
||||
|
|
Loading…
Reference in New Issue