<p><span class="issue-keyword tooltipped tooltipped-se" aria-label="This pull request closes issue #4.">Fixes</span> <a class="issue-link js-issue-link" data-error-text="Failed to load title" data-id="651366881" data-permission-text="Title is private" data-url="https://github.com/bisq-network/security/issues/4" data-hovercard-type="issue" data-hovercard-url="/bisq-network/security/issues/4/hovercard" href="https://github.com/bisq-network/security/issues/4">bisq-network/security#4</a></p>
<p>Issue: if a taker used exactly all BSQ from the BSQ inputs to pay the<br>
trading fee, there was no BSQ change in the takeOfferFeeTx. It was<br>
assumed that the second output was the reservedForTrade output, but in<br>
the case of missing BSQ change it was the first output.</p>
<p>Fix: added a check to make sure the value of the inputs to the deposit<br>
tx match the expected inputAmount.</p>
<p>Added a check that if there is no BSQ outputs in the bsqTradingFeeTx a<br>
change output is added of value 1 satoshi more than the BSQ input value.<br>
This ensures that the second output is always the reservedForTrade<br>
output. It also ensures that the BSQ is burnt, even in the very unlikely<br>
case that the amount of BSQ burnt is larger than the reservedForTrade<br>
amount.</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/4354'>https://github.com/bisq-network/bisq/pull/4354</a></p>

<h4>Commit Summary</h4>
<ul>
  <li>Fix taker use all BSQ for fee payment</li>
</ul>

<h4>File Changes</h4>
<ul>
  <li>
    <strong>M</strong>
    <a href="https://github.com/bisq-network/bisq/pull/4354/files#diff-4b50db95912975af8402691cf784faff">core/src/main/java/bisq/core/btc/wallet/BsqWalletService.java</a>
    (1)
  </li>
  <li>
    <strong>M</strong>
    <a href="https://github.com/bisq-network/bisq/pull/4354/files#diff-3618457b84b58a5b3f18c15cd10c5310">core/src/main/java/bisq/core/btc/wallet/TradeWalletService.java</a>
    (25)
  </li>
  <li>
    <strong>M</strong>
    <a href="https://github.com/bisq-network/bisq/pull/4354/files#diff-60e4fbe58ee826f1acb441f488e1b2bd">core/src/main/java/bisq/core/trade/protocol/tasks/buyer_as_taker/BuyerAsTakerCreatesDepositTxInputs.java</a>
    (9)
  </li>
</ul>

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