Skip to content
Snippets Groups Projects

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

Merged pini requested to merge pini into dev
1 file
+ 10
3
Compare changes
  • Side-by-side
  • Inline
@@ -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> {
Loading