public static bool HashCompare(byte[] hashA, byte[] hashB) { if (hashA.Length != 32) return false; if (hashB.Length != 32) return false; for (int i = 0; i < 32; i++) { if (hashA[i] != hashB[i]) return false; } return true; }
Block FindBlock(byte[] hash) { Block found = null; mBlockLock.WaitOne(); foreach (Block b in mBlocks) { if (Utils.HashCompare(b.mHeader.mHash, hash)) { found = b; break; } } mBlockLock.ReleaseMutex(); return(found); }