|
|
@ -144,15 +144,15 @@ function shouldCacheTransaction(tx) { |
|
|
|
|
|
|
|
|
|
|
|
function getBlockchainInfo() { |
|
|
|
return tryCacheThenRpcApi(miscCache, "getBlockchainInfo", 10000, rpcApi.getBlockchainInfo); |
|
|
|
return tryCacheThenRpcApi(miscCache, "getBlockchainInfo", 10 * 1000, rpcApi.getBlockchainInfo); |
|
|
|
} |
|
|
|
|
|
|
|
function getNetworkInfo() { |
|
|
|
return tryCacheThenRpcApi(miscCache, "getNetworkInfo", 10000, rpcApi.getNetworkInfo); |
|
|
|
return tryCacheThenRpcApi(miscCache, "getNetworkInfo", 10 * 1000, rpcApi.getNetworkInfo); |
|
|
|
} |
|
|
|
|
|
|
|
function getNetTotals() { |
|
|
|
return tryCacheThenRpcApi(miscCache, "getNetTotals", 10000, rpcApi.getNetTotals); |
|
|
|
return tryCacheThenRpcApi(miscCache, "getNetTotals", 10 * 1000, rpcApi.getNetTotals); |
|
|
|
} |
|
|
|
|
|
|
|
function getMempoolInfo() { |
|
|
@ -160,7 +160,7 @@ function getMempoolInfo() { |
|
|
|
} |
|
|
|
|
|
|
|
function getMiningInfo() { |
|
|
|
return tryCacheThenRpcApi(miscCache, "getMiningInfo", 30000, rpcApi.getMiningInfo); |
|
|
|
return tryCacheThenRpcApi(miscCache, "getMiningInfo", 30 * 1000, rpcApi.getMiningInfo); |
|
|
|
} |
|
|
|
|
|
|
|
function getUptimeSeconds() { |
|
|
@ -168,7 +168,7 @@ function getUptimeSeconds() { |
|
|
|
} |
|
|
|
|
|
|
|
function getChainTxStats(blockCount) { |
|
|
|
return tryCacheThenRpcApi(miscCache, "getChainTxStats-" + blockCount, 1200000, function() { |
|
|
|
return tryCacheThenRpcApi(miscCache, "getChainTxStats-" + blockCount, 20 * 60 * 1000, function() { |
|
|
|
return rpcApi.getChainTxStats(blockCount); |
|
|
|
}); |
|
|
|
} |
|
|
@ -512,7 +512,7 @@ function getMempoolStats() { |
|
|
|
var fee = txMempoolInfo.modifiedfee; |
|
|
|
var size = txMempoolInfo.vsize ? txMempoolInfo.vsize : txMempoolInfo.size; |
|
|
|
var feePerByte = txMempoolInfo.modifiedfee / size; |
|
|
|
var satoshiPerByte = feePerByte * 100000000; |
|
|
|
var satoshiPerByte = feePerByte * 100000000; // TODO: magic number - replace with coinConfig.baseCurrencyUnit.multiplier
|
|
|
|
var age = Date.now() / 1000 - txMempoolInfo.time; |
|
|
|
|
|
|
|
var addedToBucket = false; |
|
|
|