use of io.nuls.network.exception.NetworkMessageException in project nuls by nuls-io.
the class VersionEventHandler method process.
@Override
public NetworkEventResult process(BaseEvent networkEvent, Node node) {
VersionEvent event = (VersionEvent) networkEvent;
if (event.getBestBlockHeight() < 0) {
throw new NetworkMessageException(ErrorCode.NET_MESSAGE_ERROR);
}
node.setVersionMessage(event);
checkVersion(event.getNulsVersion());
if (!node.isHandShake()) {
node.setStatus(Node.HANDSHAKE);
node.setPort(event.getExternalPort());
node.setLastTime(TimeService.currentTimeMillis());
getNodeDao().saveChange(NodeTransferTool.toPojo(node));
}
return null;
}
Aggregations