public async Task Handle(PeerNotify notify, CancellationToken cancellationToken) { var newPeer = notify.Peer; var newPeerBlocks = await _communicationService.GetPeerBlocks(newPeer.Address); var newPeerList = await _communicationService.GetPeerList(newPeer.Address); foreach (var peer in newPeerList) { await _peerService.Add(peer); } await _blockService.SyncBlocks(newPeerBlocks); }
public async Task AddPeer([FromBody] Peer peer) { await _peerService.Add(peer); }