Skip to content
Snippets Groups Projects
Commit 1aefe50c authored by Éloïs's avatar Éloïs
Browse files

Merge branch 'pini' into 'dev'

fix(sync): when called with --only-peers

See merge request !1385
parents d01f2505 ab8b492e
No related branches found
No related tags found
1 merge request!1385fix(sync): when called with --only-peers
......@@ -382,16 +382,23 @@ export class RemoteSynchronizer extends AbstractSynchronizer {
}
async syncPeers(fullSync: boolean, to?: number): Promise<void> {
if (!this.node) {
await this.init();
}
const peers = await this.node.getPeers();
for (let i = 0; i < peers.length; i++) {
const peer = PeerDTO.fromJSONObject(peers[i]);
this.watcher.writeStatus("Peer " + peer.pubkey);
this.watcher.peersPercent(Math.ceil((i / peers.length) * 100));
if (this.watcher) {
this.watcher.writeStatus("Peer " + peer.pubkey);
this.watcher.peersPercent(Math.ceil((i / peers.length) * 100));
}
try {
await this.PeeringService.submitP(DBPeer.fromPeerDTO(peer));
} catch (e) {}
}
this.watcher.peersPercent(100);
if (this.watcher) {
this.watcher.peersPercent(100);
}
}
async syncSandbox(): Promise<void> {
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment