diff --git a/desktop/NodeManager.ts b/desktop/NodeManager.ts index 69f0e9ca4..3873b2c4a 100644 --- a/desktop/NodeManager.ts +++ b/desktop/NodeManager.ts @@ -778,6 +778,9 @@ class NodeManager extends AbstractManager { }; }; + private getNodeStateFile = (nodeData: string) => + path.resolve(nodeData, 'state.sql'); + private checkForPausedQuicksync = async ( nodeData: string ): Promise => { @@ -912,13 +915,20 @@ class NodeManager extends AbstractManager { } const bin = getQuicksyncPath(); - const args = [ - 'download', - '--node-data', - this.getNodeDataPath(), - '--go-spacemesh-path', - getNodePath(), - ]; + + const nodeDataPath = this.getNodeDataPath(); + const stateFile = this.getNodeStateFile(nodeDataPath); + const shouldDownloadEntire = !(await fse.pathExists(stateFile)); + + const args = shouldDownloadEntire + ? [ + 'download', + '--node-data', + nodeDataPath, + '--go-spacemesh-path', + getNodePath(), + ] + : ['partial', '-s', stateFile, '-j', '1']; logger.log('runQuicksync:download', `${bin} ${args.join(' ')}`); diff --git a/node/use-version-quicksync b/node/use-version-quicksync index 00a2c6f10..42cd91d18 100644 --- a/node/use-version-quicksync +++ b/node/use-version-quicksync @@ -1 +1 @@ -v0.1.16 +v0.2.0-alpha