mirror of
https://github.com/Retropex/apolloapi-v2.git
synced 2025-05-20 07:00:42 +02:00
Add sizeOnDisk to blockchainInfo
This commit is contained in:
parent
7cb3024143
commit
c41242ff42
@ -25,6 +25,7 @@ module.exports.typeDefs = `
|
||||
blocks: Int
|
||||
blockTime: Int
|
||||
headers: Int
|
||||
sizeOnDisk: String
|
||||
}
|
||||
|
||||
type MiningInfo {
|
||||
|
@ -5,17 +5,19 @@ const litecoin = require('litecoin');
|
||||
|
||||
module.exports = ({ define }) => {
|
||||
define('stats', async (payload, { knex, errors, utils }) => {
|
||||
|
||||
try {
|
||||
const unrefinedStats = await getNodeStats()
|
||||
|
||||
// At this point, no error present
|
||||
|
||||
const unrefinedBlockchainInfo = unrefinedStats[0];
|
||||
|
||||
// Convert sizeOnDisk to String because number too large
|
||||
const blockchainInfo = {
|
||||
blocks: unrefinedBlockchainInfo.blocks,
|
||||
blockTime: unrefinedBlockchainInfo.blockTime,
|
||||
headers: unrefinedBlockchainInfo.headers
|
||||
headers: unrefinedBlockchainInfo.headers,
|
||||
sizeOnDisk: unrefinedBlockchainInfo.size_on_disk.toString()
|
||||
};
|
||||
|
||||
// Strip miningInfo of unnecessary properties
|
||||
|
Loading…
Reference in New Issue
Block a user