|
@ -66,10 +66,20 @@ function getMempoolInfo() { |
|
|
return tryCacheThenRpcApi(miscCache, "getMempoolInfo", 1000, rpcApi.getMempoolInfo); |
|
|
return tryCacheThenRpcApi(miscCache, "getMempoolInfo", 1000, rpcApi.getMempoolInfo); |
|
|
} |
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
function getMiningInfo() { |
|
|
|
|
|
return tryCacheThenRpcApi(miscCache, "getMiningInfo", 1000, rpcApi.getMiningInfo); |
|
|
|
|
|
} |
|
|
|
|
|
|
|
|
function getUptimeSeconds() { |
|
|
function getUptimeSeconds() { |
|
|
return tryCacheThenRpcApi(miscCache, "getUptimeSeconds", 1000, rpcApi.getUptimeSeconds); |
|
|
return tryCacheThenRpcApi(miscCache, "getUptimeSeconds", 1000, rpcApi.getUptimeSeconds); |
|
|
} |
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
function getChainTxStats(blockCount) { |
|
|
|
|
|
return tryCacheThenRpcApi(miscCache, "getChainTxStats-" + blockCount, 120000, function() { |
|
|
|
|
|
return rpcApi.getChainTxStats(blockCount); |
|
|
|
|
|
}); |
|
|
|
|
|
} |
|
|
|
|
|
|
|
|
function getPeerSummary() { |
|
|
function getPeerSummary() { |
|
|
return new Promise(function(resolve, reject) { |
|
|
return new Promise(function(resolve, reject) { |
|
|
tryCacheThenRpcApi(miscCache, "getpeerinfo", 1000, rpcApi.getPeerInfo).then(function(getpeerinfo) { |
|
|
tryCacheThenRpcApi(miscCache, "getpeerinfo", 1000, rpcApi.getPeerInfo).then(function(getpeerinfo) { |
|
@ -576,6 +586,7 @@ module.exports = { |
|
|
getNetworkInfo: getNetworkInfo, |
|
|
getNetworkInfo: getNetworkInfo, |
|
|
getNetTotals: getNetTotals, |
|
|
getNetTotals: getNetTotals, |
|
|
getMempoolInfo: getMempoolInfo, |
|
|
getMempoolInfo: getMempoolInfo, |
|
|
|
|
|
getMiningInfo: getMiningInfo, |
|
|
getBlockByHeight: getBlockByHeight, |
|
|
getBlockByHeight: getBlockByHeight, |
|
|
getBlocksByHeight: getBlocksByHeight, |
|
|
getBlocksByHeight: getBlocksByHeight, |
|
|
getBlockByHash: getBlockByHash, |
|
|
getBlockByHash: getBlockByHash, |
|
@ -588,5 +599,6 @@ module.exports = { |
|
|
getRpcMethodHelp: getRpcMethodHelp, |
|
|
getRpcMethodHelp: getRpcMethodHelp, |
|
|
getAddress: getAddress, |
|
|
getAddress: getAddress, |
|
|
logCacheSizes: logCacheSizes, |
|
|
logCacheSizes: logCacheSizes, |
|
|
getPeerSummary: getPeerSummary |
|
|
getPeerSummary: getPeerSummary, |
|
|
|
|
|
getChainTxStats: getChainTxStats |
|
|
}; |
|
|
}; |