use of org.aion.p2p.INode in project aion by aionnetwork.
the class NodeMgr method updateAllNodesInfo.
public void updateAllNodesInfo(INode _n) {
Node n = (Node) _n;
if (n.hasFullInfo()) {
int fullHash = n.getFullHash();
if (allNodes.containsKey(fullHash)) {
Node orig = allNodes.get(fullHash);
// pull out metric.
orig.copyNodeStatus(n);
}
}
}
use of org.aion.p2p.INode in project aion by aionnetwork.
the class ResActiveNodes method encode.
@Override
public byte[] encode() {
ByteBuffer buf = ByteBuffer.allocate(NODE_BYTES_LENGTH * this.count + 1);
buf.put((byte) this.count);
for (INode n : this.nodes) {
buf.put(n.getId());
buf.put(n.getIp());
buf.putInt(n.getPort());
}
return buf.array();
}
Aggregations