Browse Source
longer tx-stats caching; fewer pts for homepage tx-stats graph
fix-133-memory-crash
Dan Janosik
6 years ago
No known key found for this signature in database
GPG Key ID: C6F8CE9FFDB2CED2
2 changed files with
2 additions and
2 deletions
-
app/api/coreApi.js
-
routes/baseActionsRouter.js
|
|
@ -83,7 +83,7 @@ function getUptimeSeconds() { |
|
|
|
} |
|
|
|
|
|
|
|
function getChainTxStats(blockCount) { |
|
|
|
return tryCacheThenRpcApi(miscCache, "getChainTxStats-" + blockCount, 120000, function() { |
|
|
|
return tryCacheThenRpcApi(miscCache, "getChainTxStats-" + blockCount, 1200000, function() { |
|
|
|
return rpcApi.getChainTxStats(blockCount); |
|
|
|
}); |
|
|
|
} |
|
|
|
|
|
@ -50,7 +50,7 @@ router.get("/", function(req, res) { |
|
|
|
if (getblockchaininfo.chain !== 'regtest') { |
|
|
|
var targetBlocksPerDay = 24 * 60 * 60 / global.coinConfig.targetBlockTimeSeconds; |
|
|
|
|
|
|
|
promises.push(coreApi.getTxCountStats(72, -targetBlocksPerDay, "latest")); |
|
|
|
promises.push(coreApi.getTxCountStats(targetBlocksPerDay / 4, -targetBlocksPerDay, "latest")); |
|
|
|
|
|
|
|
var chainTxStatsIntervals = [ targetBlocksPerDay, targetBlocksPerDay * 7, targetBlocksPerDay * 30, targetBlocksPerDay * 365 ] |
|
|
|
.filter(numBlocks => numBlocks <= getblockchaininfo.blocks); |
|
|
|