Skip to content
Snippets Groups Projects
Commit 28208221 authored by Gilles Filippini's avatar Gilles Filippini
Browse files

fix(1398): make sync with --onlypeers work again

parent 7a51be31
No related branches found
No related tags found
1 merge request!1439fix(1398): make sync with --onlypeers work again
Pipeline #33322 passed
...@@ -375,16 +375,19 @@ export class RemoteSynchronizer extends AbstractSynchronizer { ...@@ -375,16 +375,19 @@ export class RemoteSynchronizer extends AbstractSynchronizer {
} }
async syncPeers(fullSync: boolean, to?: number): Promise<void> { async syncPeers(fullSync: boolean, to?: number): Promise<void> {
if (!this.node) {
await this.init();
}
const peers = await this.node.getPeers(); const peers = await this.node.getPeers();
for (let i = 0; i < peers.length; i++) { for (let i = 0; i < peers.length; i++) {
const peer = PeerDTO.fromJSONObject(peers[i]); const peer = PeerDTO.fromJSONObject(peers[i]);
this.watcher.writeStatus("Peer " + peer.pubkey); // this.watcher.writeStatus("Peer " + peer.pubkey);
this.watcher.peersPercent(Math.ceil((i / peers.length) * 100)); // this.watcher.peersPercent(Math.ceil((i / peers.length) * 100));
try { try {
await this.PeeringService.submitP(DBPeer.fromPeerDTO(peer)); await this.PeeringService.submitP(DBPeer.fromPeerDTO(peer));
} catch (e) {} } catch (e) {}
} }
this.watcher.peersPercent(100); // this.watcher.peersPercent(100);
} }
async syncSandbox(): Promise<void> { 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