better logs
This commit is contained in:
parent
52570d3d40
commit
791330e82f
|
@ -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.info('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);
|
||||
});
|
||||
};
|
||||
|
|
Loading…
Reference in New Issue