Fixes detection of spendable vs. total balance. Implements refresh logic for updating view when use unconfirmed setting changes.
This commit is contained in:
parent
bee7b21288
commit
86ee84395f
2 changed files with 11 additions and 4 deletions
|
|
@ -160,16 +160,17 @@ angular.module('copayApp.services').factory('walletService', function($log, $tim
|
|||
// Address with Balance
|
||||
cache.balanceByAddress = balance.byAddress;
|
||||
|
||||
// Total wallet balance is same regardless of 'spend unconfirmed funds' setting.
|
||||
cache.totalBalanceSat = balance.totalAmount;
|
||||
|
||||
// Spend unconfirmed funds
|
||||
if (config.spendUnconfirmed) {
|
||||
cache.totalBalanceSat = balance.totalAmount;
|
||||
cache.lockedBalanceSat = balance.lockedAmount;
|
||||
cache.availableBalanceSat = balance.availableAmount;
|
||||
cache.totalBytesToSendMax = balance.totalBytesToSendMax;
|
||||
cache.pendingAmount = 0;
|
||||
cache.spendableAmount = balance.totalAmount - balance.lockedAmount;
|
||||
} else {
|
||||
cache.totalBalanceSat = balance.totalConfirmedAmount;
|
||||
cache.lockedBalanceSat = balance.lockedConfirmedAmount;
|
||||
cache.availableBalanceSat = balance.availableConfirmedAmount;
|
||||
cache.totalBytesToSendMax = balance.totalBytesToSendConfirmedMax;
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue