fix use spending unconfirmed funds

This commit is contained in:
Javier 2016-09-23 11:14:50 -03:00
parent cf5290d3e5
commit 1cf3e3d535
1 changed files with 6 additions and 6 deletions

View File

@ -189,7 +189,7 @@ angular.module('copayApp.services').factory('walletService', function($log, $tim
function cacheBalance(wallet, balance) { function cacheBalance(wallet, balance) {
if (!balance) return; if (!balance) return;
var config = configService.getSync().wallet.settings; var config = configService.getSync().wallet;
var cache = wallet.cachedStatus; var cache = wallet.cachedStatus;
@ -197,7 +197,7 @@ angular.module('copayApp.services').factory('walletService', function($log, $tim
cache.balanceByAddress = balance.byAddress; cache.balanceByAddress = balance.byAddress;
// Spend unconfirmed funds // Spend unconfirmed funds
if (cache.spendUnconfirmed) { if (config.spendUnconfirmed) {
cache.totalBalanceSat = balance.totalAmount; cache.totalBalanceSat = balance.totalAmount;
cache.lockedBalanceSat = balance.lockedAmount; cache.lockedBalanceSat = balance.lockedAmount;
cache.availableBalanceSat = balance.availableAmount; cache.availableBalanceSat = balance.availableAmount;
@ -212,9 +212,9 @@ angular.module('copayApp.services').factory('walletService', function($log, $tim
} }
// Selected unit // Selected unit
cache.unitToSatoshi = config.unitToSatoshi; cache.unitToSatoshi = config.settings.unitToSatoshi;
cache.satToUnit = 1 / cache.unitToSatoshi; cache.satToUnit = 1 / cache.unitToSatoshi;
cache.unitName = config.unitName; cache.unitName = config.settings.unitName;
//STR //STR
cache.totalBalanceStr = txFormatService.formatAmount(cache.totalBalanceSat) + ' ' + cache.unitName; cache.totalBalanceStr = txFormatService.formatAmount(cache.totalBalanceSat) + ' ' + cache.unitName;
@ -227,8 +227,8 @@ angular.module('copayApp.services').factory('walletService', function($log, $tim
cache.pendingAmountStr = null; cache.pendingAmountStr = null;
} }
cache.alternativeName = config.alternativeName; cache.alternativeName = config.settings.alternativeName;
cache.alternativeIsoCode = config.alternativeIsoCode; cache.alternativeIsoCode = config.settings.alternativeIsoCode;
rateService.whenAvailable(function() { rateService.whenAvailable(function() {