mirror of
https://github.com/logos-storage/logos-storage-nim.git
synced 2026-01-27 17:53:13 +00:00
nph
This commit is contained in:
parent
668f0b93dc
commit
5cd506dd3b
@ -246,7 +246,7 @@ proc blockPresenceHandler*(
|
||||
)
|
||||
|
||||
proc scheduleTasks(b: BlockExcEngine, blocksDelivery: seq[BlockDelivery]) {.async.} =
|
||||
let addresses = blocksDelivery.mapIt( it.address )
|
||||
let addresses = blocksDelivery.mapIt(it.address)
|
||||
# schedule any new peers to provide blocks to
|
||||
for p in b.peers:
|
||||
for address in addresses:
|
||||
|
||||
@ -66,7 +66,7 @@ func peersHave*(self: PeerCtxStore, address: BlockAddress): seq[BlockExcPeerCtx]
|
||||
toSeq(self.peers.values).filterIt(it.peerHave.anyIt(it == address))
|
||||
|
||||
func countPeersWhoHave*(self: PeerCtxStore, cid: Cid): int =
|
||||
self.peers.values.countIt(it.peerHave.anyIt( it.cidOrTreeCid == cid ) )
|
||||
self.peers.values.countIt(it.peerHave.anyIt(it.cidOrTreeCid == cid))
|
||||
|
||||
func peersWant*(self: PeerCtxStore, address: BlockAddress): seq[BlockExcPeerCtx] =
|
||||
toSeq(self.peers.values).filterIt(it.peerWants.anyIt(it == address))
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user