예제 #1
0
        public async Task MineTransaction()
        {
            //ToDo
            //get transaction pool's valid transactions
            //generate the miner reward
            //add a block consisting of these transactions to the blockchain
            //broadcast the updated  blockchain
            //clear the pool

            var validTransactions = _ITransactionPool.ValidTransactions();
            var minerReward       = Transaction.RewardTransaction(this._IWallet);

            validTransactions.Add(minerReward);
            _IBlockChain.AddBlock(validTransactions);
            await _IRedis.BroadcastChain();

            _ITransactionPool.ClearBlockchainTransaction(_IBlockChain.LocalChain);
        }