Browse Source

better logs

activeAddress
Matias Alejo Garcia 9 years ago
parent
commit
791330e82f
  1. 12
      lib/server.js

12
lib/server.js

@ -1158,14 +1158,20 @@ WalletService.prototype._sampleFeeLevels = function(network, points, cb) {
return cb(err); return cb(err);
} }
var failed = [];
var levels = _.zipObject(_.map(points, function(p) { var levels = _.zipObject(_.map(points, function(p) {
var feePerKb = _.isObject(result) ? +result[p] : -1; var feePerKb = _.isObject(result) ? +result[p] : -1;
if (feePerKb < 0) { if (feePerKb < 0)
log.info('Could not compute fee estimation (nbBlocks=' + p + ')'); failed.push(p);
}
return [p, Utils.strip(feePerKb * 1e8)]; return [p, Utils.strip(feePerKb * 1e8)];
})); }));
if (failed.length) {
var logger = network == 'livenet' ? log.warn : log.debug;
logger('Could not compute fee estimation in ' + network + ': ' + failed.join(','));
}
return cb(null, levels); return cb(null, levels);
}); });
}; };

Loading…
Cancel
Save