<p>The routine <code>cleanUpAddressEntries</code> in TradeManager was prematurely releasing funds associated with trades when they reach the last step of the process (Step 4, Withdraw to External Wallet).</p>
<p>Usually, with a single trade active this would not be an issue because <code>cleanUpAddressEntries</code> is called after the withdrawal, but if you have more than one trade at Step 4 then the first withdrawal would go though, but all the others would fail with an error box "Missing x.xxx BTC" (the trade proceeds or deposit amount).  Alternatively, if you restart the bisq app with a<br>
trade in Step 4, the same cleanup will occur and the attempt to withdraw to external wallet will fail.</p>
<p>The change here considers any trade held by the TradeManager to be in use and therefore will not have their associated address entries freed up.  After Step 4 has passed, the trade is no<br>
longer held by the TradeManager, and so <code>cleanUpAddressEntries</code> will at that point free up the address.</p>
<p><span class="issue-keyword tooltipped tooltipped-se" aria-label="This pull request closes issue #4205.">Fixes</span> <a class="issue-link js-issue-link" data-error-text="Failed to load title" data-id="608574842" data-permission-text="Title is private" data-url="https://github.com/bisq-network/bisq/issues/4205" data-hovercard-type="issue" data-hovercard-url="/bisq-network/bisq/issues/4205/hovercard" href="https://github.com/bisq-network/bisq/issues/4205">#4205</a><br>
<span class="issue-keyword tooltipped tooltipped-se" aria-label="This pull request closes issue #3592.">Fixes</span> <a class="issue-link js-issue-link" data-error-text="Failed to load title" data-id="520623814" data-permission-text="Title is private" data-url="https://github.com/bisq-network/bisq/issues/3592" data-hovercard-type="issue" data-hovercard-url="/bisq-network/bisq/issues/3592/hovercard" href="https://github.com/bisq-network/bisq/issues/3592">#3592</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/4260'>https://github.com/bisq-network/bisq/pull/4260</a></p>

<h4>Commit Summary</h4>
<ul>
  <li>Fix trade withdraw to external wallet step 4</li>
</ul>

<h4>File Changes</h4>
<ul>
  <li>
    <strong>M</strong>
    <a href="https://github.com/bisq-network/bisq/pull/4260/files#diff-5bdbc074df621c9b94b16c72ca834894">core/src/main/java/bisq/core/trade/TradeManager.java</a>
    (4)
  </li>
</ul>

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