Fix rateService

This commit is contained in:
Gustavo Maximiliano Cortez 2017-08-30 18:24:11 -03:00
commit 55c27f684c
No known key found for this signature in database
GPG key ID: 15EDAD8D9F2EB1AF

View file

@ -52,6 +52,7 @@ console.log('[rateService.js.44:updateRates:]'); //TODO
function getBTC(cb, tries) { function getBTC(cb, tries) {
tries = tries || 0; tries = tries || 0;
if (!self.httprequest) return;
if (tries > 5) return cb('could not get BTC rates'); if (tries > 5) return cb('could not get BTC rates');
//log.info('Fetching exchange rates'); //log.info('Fetching exchange rates');
@ -78,10 +79,10 @@ console.log('[rateService.js.44:updateRates:]'); //TODO
function getBCH(cb, tries) { function getBCH(cb, tries) {
tries = tries || 0; tries = tries || 0;
if (!self.httprequest) return;
if (tries > 5) return cb('could not get BCH rates'); if (tries > 5) return cb('could not get BCH rates');
function retry(tries) { function retry(tries) {
console.log('[rateService.js.84:retry:] BCH'); //TODO
//log.debug('Error fetching exchange rates', err); //log.debug('Error fetching exchange rates', err);
setTimeout(function() { setTimeout(function() {
backoffSeconds *= 1.5; backoffSeconds *= 1.5;