示例#1
0
 public async Task PublishBlock(BlockNotify newBlock)
 {
     foreach (var peer in _peers.GetAll())
     {
         await peer.Address.AppendPathSegments("api", "block", "notify")
         .PostJsonAsync(newBlock.Block);
     }
 }
示例#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);
        }