Exemplo n.º 1
0
 public async Task PublishBlock(BlockNotify newBlock)
 {
     foreach (var peer in _peers.GetAll())
     {
         await peer.Address.AppendPathSegments("api", "block", "notify")
         .PostJsonAsync(newBlock.Block);
     }
 }
Exemplo n.º 2
0
        public async Task <bool> AddBlock(Block block)
        {
            if (_blockchainInstance.Blockchain.TryAddBlock(block))
            {
                var notify = new BlockNotify(block);
                await _mediator.Publish(notify);

                return(true);
            }

            return(false);
        }