[bisq-network/bisq] Fix performance issue in BsqWalletService (#3177)

chimp1984 notifications at github.com
Sun Sep 1 20:47:44 UTC 2019


The updateBsqWalletTransactions method got called at each block for all
transactions. During block download that wasted a lot of cpu and
led to stuck UI thread and lost connections.
The updateBsqBalance is not cheap (a few ms) and called for 100s of txs
at each block was very problematic.
Furthermore the listeners on the walletTransactions observableList got
triggered which made the situation worse.

We changed the observableList to a ArrayList and use a listener which
gets called after the list is updated.
We also make sure the onTransactionConfidenceChanged listener is not
calling updateBsqWalletTransactions if bsq parsing is not complete and
if the depth of the tx is > 1.
In the updateBsqWalletTransactions method we use a flag and a delay
to ensure that the updateBsqBalance is not called more then once
in 100 ms.

We changed also the getter to return a cloned version of the list to
avoid potential concurrent modification exceptions at clients.

Closes #3175
You can view, comment on, or merge this pull request online at:

  https://github.com/bisq-network/bisq/pull/3177

-- Commit Summary --

  * Fix performance issue in BsqWalletService

-- File Changes --

    M core/src/main/java/bisq/core/btc/wallet/BsqWalletService.java (64)
    M core/src/main/java/bisq/core/dao/governance/bond/BondRepository.java (17)
    M core/src/main/java/bisq/core/dao/governance/bond/reputation/MyBondedReputationRepository.java (18)
    M core/src/main/java/bisq/core/dao/governance/bond/role/BondedRolesRepository.java (2)
    M desktop/src/main/java/bisq/desktop/main/dao/wallet/tx/BsqTxView.java (23)

-- Patch Links --

https://github.com/bisq-network/bisq/pull/3177.patch
https://github.com/bisq-network/bisq/pull/3177.diff

-- 
You are receiving this because you are subscribed to this thread.
Reply to this email directly or view it on GitHub:
https://github.com/bisq-network/bisq/pull/3177
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.bisq.network/pipermail/bisq-github/attachments/20190901/f5f2187c/attachment.html>


More information about the bisq-github mailing list