Skip to content

Commit

Permalink
Merge pull request #15 from mosadialiou/master-ios
Browse files Browse the repository at this point in the history
make sure to call balanceChanged callback whenever balance is updated
  • Loading branch information
kcw-grunt authored Mar 22, 2020
2 parents 7e10328 + 8fc4845 commit 09573b1
Showing 1 changed file with 6 additions and 0 deletions.
6 changes: 6 additions & 0 deletions BRWallet.c
Original file line number Diff line number Diff line change
Expand Up @@ -968,6 +968,9 @@ void BRWalletUpdateTransactions(BRWallet *wallet, const UInt256 txHashes[], size

if (needsUpdate) _BRWalletUpdateBalance(wallet);
pthread_mutex_unlock(&wallet->lock);
if (needsUpdate && wallet->balanceChanged) {
wallet->balanceChanged(wallet->callbackInfo, wallet->balance);
}
if (j > 0 && wallet->txUpdated) wallet->txUpdated(wallet->callbackInfo, hashes, j, blockHeight, timestamp);
}

Expand All @@ -992,6 +995,9 @@ void BRWalletSetTxUnconfirmedAfter(BRWallet *wallet, uint32_t blockHeight)

if (count > 0) _BRWalletUpdateBalance(wallet);
pthread_mutex_unlock(&wallet->lock);
if (count > 0 && wallet->balanceChanged) {
wallet->balanceChanged(wallet->callbackInfo, wallet->balance);
}
if (count > 0 && wallet->txUpdated) wallet->txUpdated(wallet->callbackInfo, hashes, count, TX_UNCONFIRMED, 0);
}

Expand Down

0 comments on commit 09573b1

Please sign in to comment.