Skip to content
Snippets Groups Projects
Commit 12291f07 authored by Cédric Moreau's avatar Cédric Moreau
Browse files

[fix] WS2P: the server may crash on startup if pulling a same block twice

parent 8b1bd907
Branches
Tags
No related merge requests found
...@@ -475,8 +475,12 @@ export class WS2PCluster { ...@@ -475,8 +475,12 @@ export class WS2PCluster {
const chosen = randomPick(connections, CrawlerConstants.CRAWL_PEERS_COUNT) const chosen = randomPick(connections, CrawlerConstants.CRAWL_PEERS_COUNT)
await Promise.all(chosen.map(async (conn) => { await Promise.all(chosen.map(async (conn) => {
try {
const puller = new WS2PBlockPuller(this.server, conn) const puller = new WS2PBlockPuller(this.server, conn)
await puller.pull() await puller.pull()
} catch (e) {
this.server.logger.warn(e)
}
})) }))
await this.server.BlockchainService.pushFIFO("WS2PCrawlerResolution", async () => { await this.server.BlockchainService.pushFIFO("WS2PCrawlerResolution", async () => {
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please to comment