Browse Source

minor code cleanup

master
Dan Janosik 5 years ago
parent
commit
4fa6b47ab3
No known key found for this signature in database GPG Key ID: C6F8CE9FFDB2CED2
  1. 12
      app/api/coreApi.js
  2. 1
      app/coins/btc.js

12
app/api/coreApi.js

@ -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;

1
app/coins/btc.js

@ -63,6 +63,7 @@ module.exports = {
"https://raw.githubusercontent.com/blockchain/Blockchain-Known-Pools/master/pools.json"
],
maxBlockWeight: 4000000,
maxBlockSize: 1000000,
targetBlockTimeSeconds: 600,
currencyUnits:currencyUnits,
currencyUnitsByName:{"BTC":currencyUnits[0], "mBTC":currencyUnits[1], "bits":currencyUnits[2], "sat":currencyUnits[3]},

Loading…
Cancel
Save