Skip to content

Commit

Permalink
Revert change to default case on sync percent
Browse files Browse the repository at this point in the history
  • Loading branch information
deverickapollo committed Mar 9, 2024
1 parent e6abd04 commit eb77ed9
Showing 1 changed file with 5 additions and 5 deletions.
10 changes: 5 additions & 5 deletions services/monerod.js
Original file line number Diff line number Diff line change
Expand Up @@ -128,19 +128,19 @@ async function getTransaction(txHash) {
}

function getSyncPercentage(height, targetHeight) {
// print log message for height and targetHeight
// console.log('height: ', height, ' targetHeight: ', targetHeight);
if (targetHeight > height && targetHeight !== 0) {
if (targetHeight === 0 && height === 0) {
return 0;
}
if (targetHeight > height) {
// eslint-disable-next-line no-magic-numbers
return Number((height / targetHeight).toFixed(4));
}
return 0;
return 1;
}

async function getBlockChainInfo() {
try {
const {state: infoState} = await daemonController.daemon.getInfo();

const miningInfo = await daemonController.daemon.getTxPoolStats();
const info = {
result: {
Expand Down

0 comments on commit eb77ed9

Please sign in to comment.