Skip to content

Commit

Permalink
fix: fix #27: Daemon will start synchronisation from block undefined
Browse files Browse the repository at this point in the history
  • Loading branch information
Jblew committed Dec 11, 2018
1 parent 5c055aa commit 1b3d6f7
Showing 1 changed file with 6 additions and 7 deletions.
13 changes: 6 additions & 7 deletions src/actions/InitAction.ts
Original file line number Diff line number Diff line change
Expand Up @@ -87,6 +87,12 @@ export class InitAction {
});
});

if (sinceBlock === undefined) {
console.log("Fetching HEAD block number...");
sinceBlock = (await new DirectBlockchainApi(Wise.constructDefaultProtocol()).getDynamicGlobalProperties()).head_block_number;
console.log("HEAB block number is " + sinceBlock);
}

console.log("--- Your settings ---");
console.log("Account name: " + username);
console.log("Save posting key: " +
Expand Down Expand Up @@ -114,13 +120,6 @@ export class InitAction {
}


if (sinceBlock === undefined) {
console.log("Fetching HEAD block number...");
sinceBlock = (await new DirectBlockchainApi(Wise.constructDefaultProtocol()).getDynamicGlobalProperties()).head_block_number;
console.log("HEAB block number is " + sinceBlock);
}


console.log("Writing " + configPath + "");
const configObj = _.merge({}, StaticConfig.DEFAULT_CONFIG, {
username: username,
Expand Down

0 comments on commit 1b3d6f7

Please sign in to comment.