public async Task UpdateOrAddTransactionAsync(Transaction transaction)
        {
            bool editMode = await _dbContext.Transactions.AnyAsync(t => t.Id == transaction.Id);

            if (editMode)
            {
                _dbContext.Update(transaction);
            }
            else
            {
                _dbContext.Add(transaction);
            }

            await _dbContext.SaveChangesAsync();
        }
        public async Task <Block> AddBlock(List <Transaction> data)
        {
            Block lastBlock = await _dbContext.Blocks.LastAsync();

            Block block = _blockService.MineBlock(lastBlock, data);

            _dbContext.Blocks.Add(block);
            await _dbContext.SaveChangesAsync();

            //Can't use Constructor DI Because of circular injection
            _p2PNetwork = _serviceProvider.GetService <P2PNetwork>();
            _p2PNetwork.SyncChains();

            return(block);
        }