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

Commit

Permalink
update bitcoind.js
Browse files Browse the repository at this point in the history
  • Loading branch information
mayankchhabra authored Apr 26, 2020
1 parent 141e0ad commit 7f149c6
Showing 1 changed file with 2 additions and 7 deletions.
9 changes: 2 additions & 7 deletions logic/bitcoind.js
Original file line number Diff line number Diff line change
Expand Up @@ -71,17 +71,13 @@ async function getLocalSyncInfo() {

var blockCount = blockChainInfo.blocks;
var headerCount = blockChainInfo.headers;
var blockchainDifficulty = blockChainInfo.difficulty;
var blockchainSize = blockChainInfo.sizeOnDisk;

const percentSynced = (Math.trunc(blockCount / headerCount * 10000) / 10000).toFixed(4); // eslint-disable-line no-magic-numbers, max-len

return {
percent: percentSynced,
currentBlock: blockCount,
headerCount: headerCount, // eslint-disable-line object-shorthand,
difficulty: blockchainDifficulty,
size: blockchainSize
headerCount: headerCount // eslint-disable-line object-shorthand,
};
}

Expand Down Expand Up @@ -169,10 +165,9 @@ async function nodeStatusSummary() {
const miningInfo = await bitcoindService.getMiningInfo();

return {
blocks: blockchainInfo.result.blocks,
difficulty: blockchainInfo.result.difficulty,
size: blockchainInfo.result.sizeOnDisk,
mempool: mempoolInfo.result,
mempool: mempoolInfo.result.bytes,
connections: networkInfo.result.connections,
networkhashps: miningInfo.result.networkhashps
}
Expand Down

0 comments on commit 7f149c6

Please sign in to comment.