Browse Source

reduce excessive logging

fix-133-memory-crash
Dan Janosik 7 years ago
parent
commit
8dcc16c6df
  1. 5
      app/api/coreApi.js
  2. 6
      app/api/rpcApi.js

5
app/api/coreApi.js

@ -26,7 +26,7 @@ function getGenesisCoinbaseTransactionId() {
function tryCacheThenRpcApi(cache, cacheKey, cacheMaxAge, rpcApiFunction) {
console.log("tryCache: " + cacheKey + ", " + cacheMaxAge);
//console.log("tryCache: " + cacheKey + ", " + cacheMaxAge);
return new Promise(function(resolve, reject) {
var result = cache.get(cacheKey);
@ -270,8 +270,7 @@ function getBlocksByHeight(blockHeights) {
} else {
var queriedBlock = queriedBlocks[queriedBlocksCurrentIndex];
console.log("queriedBlock: " + queriedBlock);
combinedBlocks.push(queriedBlock);
blockCache.set("getBlockByHeight-" + queriedBlock.height, queriedBlock, 3600000);

6
app/api/rpcApi.js

@ -47,7 +47,7 @@ function getBlockByHeight(blockHeight) {
}
function getBlocksByHeight(blockHeights) {
console.log("getBlocksByHeight: " + blockHeights);
//console.log("getBlocksByHeight: " + blockHeights);
return new Promise(function(resolve, reject) {
var batch = [];
@ -147,7 +147,7 @@ function getAddress(address) {
}
function getRawTransactions(txids) {
console.log("getRawTransactions: " + txids);
//console.log("getRawTransactions: " + txids);
return new Promise(function(resolve, reject) {
if (!txids || txids.length == 0) {
@ -194,8 +194,6 @@ function getRawTransactions(txids) {
}));
Promise.all(promises).then(function(results) {
console.log(JSON.stringify(results));
var finalResults = [];
for (var i = 0; i < results.length; i++) {
for (var j = 0; j < results[i].length; j++) {

Loading…
Cancel
Save