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