Browse Source

longer tx-stats caching; fewer pts for homepage tx-stats graph

fix-133-memory-crash
Dan Janosik 6 years ago
parent
commit
6dee201505
No known key found for this signature in database GPG Key ID: C6F8CE9FFDB2CED2
  1. 2
      app/api/coreApi.js
  2. 2
      routes/baseActionsRouter.js

2
app/api/coreApi.js

@ -83,7 +83,7 @@ function getUptimeSeconds() {
} }
function getChainTxStats(blockCount) { function getChainTxStats(blockCount) {
return tryCacheThenRpcApi(miscCache, "getChainTxStats-" + blockCount, 120000, function() { return tryCacheThenRpcApi(miscCache, "getChainTxStats-" + blockCount, 1200000, function() {
return rpcApi.getChainTxStats(blockCount); return rpcApi.getChainTxStats(blockCount);
}); });
} }

2
routes/baseActionsRouter.js

@ -50,7 +50,7 @@ router.get("/", function(req, res) {
if (getblockchaininfo.chain !== 'regtest') { if (getblockchaininfo.chain !== 'regtest') {
var targetBlocksPerDay = 24 * 60 * 60 / global.coinConfig.targetBlockTimeSeconds; 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 ] var chainTxStatsIntervals = [ targetBlocksPerDay, targetBlocksPerDay * 7, targetBlocksPerDay * 30, targetBlocksPerDay * 365 ]
.filter(numBlocks => numBlocks <= getblockchaininfo.blocks); .filter(numBlocks => numBlocks <= getblockchaininfo.blocks);

Loading…
Cancel
Save