예제 #1
0
        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);
        }
예제 #2
0
 public async Task AddPeer([FromBody] Peer peer)
 {
     await _peerService.Add(peer);
 }