Iterator<byte[]> hashIterator = receivedHashes.iterator();
byte[] foundHash, latestHash = blockchain.getBestBlockHash();
while (hashIterator.hasNext()) {
foundHash = hashIterator.next();
if (FastByteComparisons.compareTo(foundHash, 0, 32, latestHash, 0, 32) != 0){
chainQueue.addHash(foundHash); // store unknown hashes in queue until known hash is found
}
else {
logger.trace("Catch up with the hashes until: {[]}", foundHash);
// if known hash is found, ignore the rest