<p>The updateBsqWalletTransactions method got called at each block for all<br>
transactions. During block download that wasted a lot of cpu and<br>
led to stuck UI thread and lost connections.<br>
The updateBsqBalance is not cheap (a few ms) and called for 100s of txs<br>
at each block was very problematic.<br>
Furthermore the listeners on the walletTransactions observableList got<br>
triggered which made the situation worse.</p>
<p>We changed the observableList to a ArrayList and use a listener which<br>
gets called after the list is updated.<br>
We also make sure the onTransactionConfidenceChanged listener is not<br>
calling updateBsqWalletTransactions if bsq parsing is not complete and<br>
if the depth of the tx is > 1.<br>
In the updateBsqWalletTransactions method we use a flag and a delay<br>
to ensure that the updateBsqBalance is not called more then once<br>
in 100 ms.</p>
<p>We changed also the getter to return a cloned version of the list to<br>
avoid potential concurrent modification exceptions at clients.</p>
<p><span class="issue-keyword tooltipped tooltipped-se" aria-label="This pull request closes issue #3175.">Closes</span> <a class="issue-link js-issue-link" data-error-text="Failed to load issue title" data-id="487893690" data-permission-text="Issue title is private" data-url="https://github.com/bisq-network/bisq/issues/3175" data-hovercard-type="issue" data-hovercard-url="/bisq-network/bisq/issues/3175/hovercard" href="https://github.com/bisq-network/bisq/issues/3175">#3175</a></p>

<hr>

<h4>You can view, comment on, or merge this pull request online at:</h4>
<p>  <a href='https://github.com/bisq-network/bisq/pull/3177'>https://github.com/bisq-network/bisq/pull/3177</a></p>

<h4>Commit Summary</h4>
<ul>
  <li>Fix performance issue in BsqWalletService</li>
</ul>

<h4>File Changes</h4>
<ul>
  <li>
    <strong>M</strong>
    <a href="https://github.com/bisq-network/bisq/pull/3177/files#diff-0">core/src/main/java/bisq/core/btc/wallet/BsqWalletService.java</a>
    (64)
  </li>
  <li>
    <strong>M</strong>
    <a href="https://github.com/bisq-network/bisq/pull/3177/files#diff-1">core/src/main/java/bisq/core/dao/governance/bond/BondRepository.java</a>
    (17)
  </li>
  <li>
    <strong>M</strong>
    <a href="https://github.com/bisq-network/bisq/pull/3177/files#diff-2">core/src/main/java/bisq/core/dao/governance/bond/reputation/MyBondedReputationRepository.java</a>
    (18)
  </li>
  <li>
    <strong>M</strong>
    <a href="https://github.com/bisq-network/bisq/pull/3177/files#diff-3">core/src/main/java/bisq/core/dao/governance/bond/role/BondedRolesRepository.java</a>
    (2)
  </li>
  <li>
    <strong>M</strong>
    <a href="https://github.com/bisq-network/bisq/pull/3177/files#diff-4">desktop/src/main/java/bisq/desktop/main/dao/wallet/tx/BsqTxView.java</a>
    (23)
  </li>
</ul>

<h4>Patch Links:</h4>
<ul>
  <li><a href='https://github.com/bisq-network/bisq/pull/3177.patch'>https://github.com/bisq-network/bisq/pull/3177.patch</a></li>
  <li><a href='https://github.com/bisq-network/bisq/pull/3177.diff'>https://github.com/bisq-network/bisq/pull/3177.diff</a></li>
</ul>

<p style="font-size:small;-webkit-text-size-adjust:none;color:#666;">—<br />You are receiving this because you are subscribed to this thread.<br />Reply to this email directly, <a href="https://github.com/bisq-network/bisq/pull/3177?email_source=notifications&email_token=AJFFTNTO2VHOUMYPA7RQSK3QHQS7BA5CNFSM4ISX6262YY3PNVWWK3TUL52HS4DFUVEXG43VMWVGG33NNVSW45C7NFSM4HIVGZGA">view it on GitHub</a>, or <a href="https://github.com/notifications/unsubscribe-auth/AJFFTNVM4IUD2I4DXWNZC2TQHQS7BANCNFSM4ISX626Q">mute the thread</a>.<img src="https://github.com/notifications/beacon/AJFFTNTHBADIEFTD3CEUAODQHQS7BA5CNFSM4ISX6262YY3PNVWWK3TUL52HS4DFUVEXG43VMWVGG33NNVSW45C7NFSM4HIVGZGA.gif" height="1" width="1" alt="" /></p>
<script type="application/ld+json">[
{
"@context": "http://schema.org",
"@type": "EmailMessage",
"potentialAction": {
"@type": "ViewAction",
"target": "https://github.com/bisq-network/bisq/pull/3177?email_source=notifications\u0026email_token=AJFFTNTO2VHOUMYPA7RQSK3QHQS7BA5CNFSM4ISX6262YY3PNVWWK3TUL52HS4DFUVEXG43VMWVGG33NNVSW45C7NFSM4HIVGZGA",
"url": "https://github.com/bisq-network/bisq/pull/3177?email_source=notifications\u0026email_token=AJFFTNTO2VHOUMYPA7RQSK3QHQS7BA5CNFSM4ISX6262YY3PNVWWK3TUL52HS4DFUVEXG43VMWVGG33NNVSW45C7NFSM4HIVGZGA",
"name": "View Pull Request"
},
"description": "View this Pull Request on GitHub",
"publisher": {
"@type": "Organization",
"name": "GitHub",
"url": "https://github.com"
}
}
]</script>