Example #1
0
        public IBlock SolveFunction(object data)
        {
            IBlock newBlock = _blockFactory.GenerateVoidBlock();

            for (var i = 0; i < 100000; i++)
            {
                var block = _blockFactory.GenerateNextBlock(Blockchain.GetLastBlock(),
                                                            data, i);

                if (DoesBlockSolveFunction(block))
                {
                    newBlock = block;
                    break;
                }
            }

            return(newBlock);
        }