|
@ -119,7 +119,7 @@ FiatRateService.prototype.getRate = function(opts, cb) { |
|
|
async.map([].concat(ts), function(ts, cb) { |
|
|
async.map([].concat(ts), function(ts, cb) { |
|
|
self.storage.fetchFiatRate(provider, opts.code, ts, function(err, rate) { |
|
|
self.storage.fetchFiatRate(provider, opts.code, ts, function(err, rate) { |
|
|
if (err) return cb(err); |
|
|
if (err) return cb(err); |
|
|
if (rate && (now - rate.ts) > Defaults.FIAT_RATE_MAX_LOOK_BACK_TIME * 60 * 1000) rate = null; |
|
|
if (rate && (ts - rate.ts) > Defaults.FIAT_RATE_MAX_LOOK_BACK_TIME * 60 * 1000) rate = null; |
|
|
|
|
|
|
|
|
return cb(null, { |
|
|
return cb(null, { |
|
|
ts: +ts, |
|
|
ts: +ts, |
|
|