<p><span class="issue-keyword tooltipped tooltipped-se" aria-label="This pull request closes issue #5331.">Fixes</span> <a class="issue-link js-issue-link" data-error-text="Failed to load title" data-id="835999856" data-permission-text="Title is private" data-url="https://github.com/bisq-network/bisq/issues/5331" data-hovercard-type="issue" data-hovercard-url="/bisq-network/bisq/issues/5331/hovercard" href="https://github.com/bisq-network/bisq/issues/5331">#5331</a>, <a class="issue-link js-issue-link" data-error-text="Failed to load title" data-id="831288386" data-permission-text="Title is private" data-url="https://github.com/bisq-network/bisq/issues/5305" data-hovercard-type="issue" data-hovercard-url="/bisq-network/bisq/issues/5305/hovercard" href="https://github.com/bisq-network/bisq/issues/5305">#5305</a></p>
<p>There is a race condition with the BTC display of the sent confirmation popup.  The address field and senders amount were obtained from GUI input elements which are cleared after a transaction has been sent.  So the fields could be empty when the confirmation popup is shown after the wallet calls back with success.</p>
<p>Solution is to move a variable <code>sendersAmount</code> from class scope to method scope and make it final.  Likewise the <code>withdrawToAddress</code> must be defined in method scope so that the method does not access the GUI input field after it has been cleared.</p>
<p>The problem does not occur for displaying BSQ sent transactions, because the relevant parameters are already method-scoped and immutable.</p>
<hr>
<p><strong>Testing</strong></p>
<p>The issue can be reproduced consistently if you introduce a delay of 1 second in the processing of the wallet OnSuccess callback.</p>
<pre><code>// testing fix for #5331 [delay the async popup by 1 sec]
UserThread.runAfter(() -> {
    new TxDetails(transaction.getTxId().toString(), withdrawToAddress, formatter.formatCoinWithCode(sendersAmount))
            .dontShowAgainId(key)
            .show();
}, 1, TimeUnit.SECONDS);
</code></pre>
<p>It helps verify that the fix works correctly.  (The delay was for testing/verification only, not included in PR).</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/5333'>https://github.com/bisq-network/bisq/pull/5333</a></p>

<h4>Commit Summary</h4>
<ul>
  <li>fix race condition in sent confirmation popup</li>
</ul>

<h4>File Changes</h4>
<ul>
  <li>
    <strong>M</strong>
    <a href="https://github.com/bisq-network/bisq/pull/5333/files#diff-1899e161042b90cb20b10511f052d0c6237757c97ba32fb35dddb31fccb9cb4b">desktop/src/main/java/bisq/desktop/main/funds/withdrawal/WithdrawalView.java</a>
    (17)
  </li>
</ul>

<h4>Patch Links:</h4>
<ul>
  <li><a href='https://github.com/bisq-network/bisq/pull/5333.patch'>https://github.com/bisq-network/bisq/pull/5333.patch</a></li>
  <li><a href='https://github.com/bisq-network/bisq/pull/5333.diff'>https://github.com/bisq-network/bisq/pull/5333.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/5333">view it on GitHub</a>, or <a href="https://github.com/notifications/unsubscribe-auth/AJFFTNXS5B6UHZ2M4XL3AJ3TENXIPANCNFSM4ZPBQGOA">unsubscribe</a>.<img src="https://github.com/notifications/beacon/AJFFTNSVJ7V76DH4S4YOMOTTENXIPA5CNFSM4ZPBQGOKYY3PNVWWK3TUL52HS4DFUVEXG43VMWVGG33NNVSW45C7NFSM4MOWQK7A.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/5333",
"url": "https://github.com/bisq-network/bisq/pull/5333",
"name": "View Pull Request"
},
"description": "View this Pull Request on GitHub",
"publisher": {
"@type": "Organization",
"name": "GitHub",
"url": "https://github.com"
}
}
]</script>