Skip to content
This repository has been archived by the owner on Sep 18, 2022. It is now read-only.

Commit

Permalink
LND sync logic
Browse files Browse the repository at this point in the history
  • Loading branch information
mayankchhabra committed Jun 5, 2020
1 parent 9c3e5ad commit 890f4c8
Showing 1 changed file with 3 additions and 4 deletions.
7 changes: 3 additions & 4 deletions logic/lightning.js
Original file line number Diff line number Diff line change
Expand Up @@ -595,13 +595,12 @@ async function getSyncStatus() {
percentSynced = ((info.bestHeaderTimestamp - genesisTimestamp) / (currentTime - genesisTimestamp))
.toFixed(4); // eslint-disable-line no-magic-numbers

// let's not return a value over the 100% or processedBlocks > blockHeight
// space-fleet can determine how to handle this error state if it detects -1
// let's not return a value over the 100% or when processedBlocks > blockHeight
if (percentSynced < 1.0) {
processedBlocks = Math.floor(percentSynced * info.blockHeight);
} else {
processedBlocks = -1;
percentSynced = -1;
processedBlocks = info.blockHeight;
percentSynced = (1).toFixed(4);
}

} else {
Expand Down

0 comments on commit 890f4c8

Please sign in to comment.