CentralMine.NET.HashManager.FindFreeBlock C# (CSharp) Method

FindFreeBlock() private method

private FindFreeBlock ( uint desiredSize ) : HashBlock
desiredSize uint
return HashBlock
        HashBlock FindFreeBlock(uint desiredSize)
        {
            HashBlock free = null;

            foreach (HashBlock hb in mFreeBlocks)
            {
                if (hb.Count >= desiredSize)
                {
                    free = hb;
                    break;
                }
            }

            if (free == null && mFreeBlocks.Count > 0)
            {
                // Didnt find a large enough block, use the first block instead
                free = mFreeBlocks[0];
            }

            return free;
        }