Fix sendMax, support bch. Fee levels cache for bch
This commit is contained in:
parent
1200c9701c
commit
8b2265d767
2 changed files with 31 additions and 17 deletions
|
|
@ -17,6 +17,7 @@ angular.module('copayApp.services').factory('feeService', function($log, $timeou
|
|||
|
||||
var cache = {
|
||||
updateTs: 0,
|
||||
coin: ''
|
||||
};
|
||||
|
||||
root.getCurrentFeeLevel = function() {
|
||||
|
|
@ -60,7 +61,7 @@ angular.module('copayApp.services').factory('feeService', function($log, $timeou
|
|||
root.getFeeLevels = function(coin, cb) {
|
||||
coin = coin || 'btc';
|
||||
|
||||
if (cache.updateTs > Date.now() - CACHE_TIME_TS * 1000) {
|
||||
if (cache.coin == coin && cache.updateTs > Date.now() - CACHE_TIME_TS * 1000) {
|
||||
return cb(null, cache.data, true);
|
||||
}
|
||||
|
||||
|
|
@ -73,6 +74,7 @@ angular.module('copayApp.services').factory('feeService', function($log, $timeou
|
|||
}
|
||||
|
||||
cache.updateTs = Date.now();
|
||||
cache.coin = coin;
|
||||
cache.data = {
|
||||
'livenet': levelsLivenet,
|
||||
'testnet': levelsTestnet
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue