Merge pull request #468 from matiu/loglevel

change log level of fee estimation
This commit is contained in:
Ivan Socolsky 2016-02-23 16:12:50 -03:00
commit 297c4e3f68
1 changed files with 9 additions and 3 deletions

View File

@ -1158,14 +1158,20 @@ WalletService.prototype._sampleFeeLevels = function(network, points, cb) {
return cb(err);
}
var failed = [];
var levels = _.zipObject(_.map(points, function(p) {
var feePerKb = _.isObject(result) ? +result[p] : -1;
if (feePerKb < 0) {
log.warn('Could not compute fee estimation (nbBlocks=' + p + ')');
}
if (feePerKb < 0)
failed.push(p);
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);
});
};