<p></p>

<h3>Description</h3>
<p>Since version 1.7.0 I'm facing multiple issues with balance accounting. I'm trying to do a lot of trading (few offers per day), but those issues are stopping me really. And one thing when I have workaround like this issue: <a class="issue-link js-issue-link" data-error-text="Failed to load title" data-id="942528629" data-permission-text="Title is private" data-url="https://github.com/bisq-network/bisq/issues/5623" data-hovercard-type="issue" data-hovercard-url="/bisq-network/bisq/issues/5623/hovercard" href="https://github.com/bisq-network/bisq/issues/5623">#5623</a> and another, when I'm kind of lost access to the funds: 0.02159616 BTC in this case.</p>
<p>It's also inconvenient from prospective that I need to halt all trading and start troubleshooting and compile report.</p>
<p>I'm fully supportive of idea of distributed exchange without KYC and stuff, and ready to spend some time helping, but if Bisq is safe only in scope of 1 operation at once: transfer money, do exchange and then withdraw, then I think Bisq is moving in wrong direction - it should be robust regardless of amount of transactions I'm making. I also cannot say that I'm making more transactions than before 1.7.0 version. And it was rock solid back then.</p>
<p>Saying this, I'd like to bring more attention to this issue, as, again, I'm facing this at least once a week during active trading.</p>
<p>Now to the issue:</p>
<p>I've stepped into the issue which described in <a class="issue-link js-issue-link" data-error-text="Failed to load title" data-id="942528629" data-permission-text="Title is private" data-url="https://github.com/bisq-network/bisq/issues/5623" data-hovercard-type="issue" data-hovercard-url="/bisq-network/bisq/issues/5623/hovercard" href="https://github.com/bisq-network/bisq/issues/5623">#5623</a>, when my balance is not recognized by Bisq (Actual balance was ~0.05 BTC, trade was for 0.01 BTC and I was unable to make a deposit - Bisq was reporting that I do not have enough funds, like "Needed 0.023245 BTC, you have 0.02 BTC, so 0.003245 BTC is missing).</p>
<p>So I've made a internal transfer of funds:</p>
<ol>
<li>Went to Funds -> Receive funds, copy-pasted address, which was there by default</li>
<li>Went to Funds -> Send funds, pasted address which was copied (bc1qnvwx9xfeh34v4e7tws2ll3fdspjra4uhllwfyu), pressed "Use all available inputs", "Amount includes mining fee", set custom transaction fee of 5 sats/vbyte and pressed "Withdraw selected"</li>
<li>Transaction 579b536d9fd2f5be04ef04c1265d10439bdac1c067fa623887c6a99b138f68ce was registered.</li>
<li>I was able to continue with my offer.</li>
</ol>
<p>I've made a trade with ID #92920380-fbba8c48-002b-4670-8f82-8d5cfeda7696-172. Fees were paid by BSQ. I'm maker.</p>
<p>After that weird things has started. Here is screenshot of the trade and I will try to follow it's trace:<br>
<a target="_blank" rel="noopener noreferrer" href="https://user-images.githubusercontent.com/87337102/129236776-bb9f5445-2d6b-4ab8-8314-40e5244f30f8.png"><img src="https://user-images.githubusercontent.com/87337102/129236776-bb9f5445-2d6b-4ab8-8314-40e5244f30f8.png" alt="image" style="max-width:100%;"></a></p>
<ol>
<li>Transaction with maker fee: ed197cfb468a18aefcee93142a8a63eb08ff6f5c080ea4373ce1ac64344dc94d. Fee should be small and only first address (bc1qwrwgq4089syrke44msc9ak7xx4tr6zyzkspt24) withdrawal should cover it, however Bisq withdraws 0.05162043 BTC (my actual balance at that point) from bc1qnvwx9xfeh34v4e7tws2ll3fdspjra4uhllwfyu and sends 0.02159616 BTC back to the same address (why?). BTW, this amount is lost currently, thus the ticket.</li>
</ol>
<p>The rest of the trade finishes properly: buyer sends money, and I get back my security deposit.</p>
<ol start="2">
<li>I get 0.01 BTC from security deposit transaction on address bc1q4vmp7lwe3tnvupgsv22et00em8mq4egx0rmp4f</li>
<li>I get 0.01 BTC from payout transaction on address bc1qzsaeyfcmy7r5j32dkfzcwxunlf6c32zrj3ezgl</li>
</ol>
<p>This results into I've started trade with 0.05162043 BTC, sold 0.01 BTC and currently my balance is 0.02 BTC exactly. Address bc1qnvwx9xfeh34v4e7tws2ll3fdspjra4uhllwfyu still holds 0.02159616 BTC, but it's no longer visible in Funds -> Receive funds section and not visible in Bisq client "Actual balance".</p>
<p>One more issue that in Funds -> Transactions section I see transaction with 0.05162043 BTC transfer to bc1qnvwx9xfeh34v4e7tws2ll3fdspjra4uhllwfyu  as this:</p>
<p><a target="_blank" rel="noopener noreferrer" href="https://user-images.githubusercontent.com/87337102/129240287-c2ee1ca5-7bdb-4c6f-9c8b-40ddccf040f0.png"><img src="https://user-images.githubusercontent.com/87337102/129240287-c2ee1ca5-7bdb-4c6f-9c8b-40ddccf040f0.png" alt="image" style="max-width:100%;"></a></p>
<h2>While I was expecting to see 2 transactions: one for withdrawal, one for income.</h2>
<h4>Version</h4>
<p>1.7.2</p>
<h3>Steps to reproduce</h3>
<p>It's hard to say if this is reproducible out of the box, but I've tried to describe steps above. I would summarize them here with my current state of the client:</p>
<ol>
<li>Fund your wallet on 0.05 BTC</li>
<li>Get on your Bisq account ~600 BSQ</li>
<li>Open trade offer for selling BSQ (all of them)</li>
<li>Open trade offer for selling BTC (mine was 0.02 BTC with 0.01 BTC minimum with -1% margin), however do not fund the offer yet (in my case I've got insufficient funds)</li>
<li>Transfer all BTC from Bisq wallet to new address which you can get from Funds -> Receive funds</li>
<li>Do not wait for block confirmation of this transaction, get back to open trade offer for selling BTC and fund it.</li>
<li>Get this offer accepted and proceeded normally.</li>
<li>This should result into loss of funds as described above.</li>
</ol>
<h3>Expected behaviour</h3>
<p>My balance is reduced on:</p>
<ol>
<li>Trade amount (0.01 BTC)</li>
<li>Transaction fee (0.00002450 BTC) or BSQ fee</li>
<li>Mining fee for 4 transactions</li>
</ol>
<h3>Actual behaviour</h3>
<p>0.02159616 BTC was lost and resides on address which is not added to Bisq wallet for some reason.</p>
<h3>Screenshots</h3>
<p>Provided above in context.</p>
<h4>Device or machine</h4>
<p>Ryzen 5 3600, 32 Gb of RAM. Windows 10 x64, ver 1709.</p>
<h4>Additional info</h4>

<p>I've tried to resync SPV wallet, however it didn't change anything.</p>
<p>Here are the logs of creation of transaction: 579b536d9fd2f5be04ef04c1265d10439bdac1c067fa623887c6a99b138f68ce</p>
<pre><code>Aug-09 21:41:44.364 [BlockingClient network thread for 3r44ddzjitznyahw.onion/<unresolved>:8333] INFO  o.b.w.Wallet: Received tx for -0.0000123 BTC: 579b536d9fd2f5be04ef04c1265d10439bdac1c067fa623887c6a99b138f68ce [0] in block 0000000000000000000c4f397f28ba18acf416127190d66ae2cc2332bd5e4d8b 
Aug-09 21:41:44.364 [BlockingClient network thread for 3r44ddzjitznyahw.onion/<unresolved>:8333] INFO  o.b.w.Wallet:   <-pending 
Aug-09 21:41:44.365 [BlockingClient network thread for 3r44ddzjitznyahw.onion/<unresolved>:8333] INFO  o.b.w.Wallet: Connected pending tx input ed197cfb468a18aefcee93142a8a63eb08ff6f5c080ea4373ce1ac64344dc94d:1 
Aug-09 21:41:44.366 [BlockingClient network thread for 3r44ddzjitznyahw.onion/<unresolved>:8333] INFO  o.b.w.Wallet: Removed from UNSPENTS: TxOut of 0.05162043 BTC to bc1qnvwx9xfeh34v4e7tws2ll3fdspjra4uhllwfyu script:0[] PUSHDATA(20)[9b1c629939bc6acae7cb7415ffc52d80643ed797] 
Aug-09 21:41:44.366 [BlockingClient network thread for 3r44ddzjitznyahw.onion/<unresolved>:8333] INFO  o.b.w.Wallet:   tx 579b536d9fd2f5be04ef04c1265d10439bdac1c067fa623887c6a99b138f68ce ->spent (by pending) 
Aug-09 21:41:44.368 [BlockingClient network thread for 3r44ddzjitznyahw.onion/<unresolved>:8333] INFO  o.b.w.Wallet: Balance is now: 0.05908071 BTC 
Aug-09 21:41:44.369 [BlockingClient network thread for 3r44ddzjitznyahw.onion/<unresolved>:8333] INFO  o.b.w.Wallet: Received tx for -0.00002427 BTC: ed197cfb468a18aefcee93142a8a63eb08ff6f5c080ea4373ce1ac64344dc94d [1] in block 0000000000000000000c4f397f28ba18acf416127190d66ae2cc2332bd5e4d8b 
Aug-09 21:41:44.369 [BlockingClient network thread for 3r44ddzjitznyahw.onion/<unresolved>:8333] INFO  o.b.w.Wallet:   <-pending 
Aug-09 21:41:44.369 [BlockingClient network thread for 3r44ddzjitznyahw.onion/<unresolved>:8333] INFO  o.b.w.Wallet:   tx ed197cfb468a18aefcee93142a8a63eb08ff6f5c080ea4373ce1ac64344dc94d ->unspent 
Aug-09 21:41:44.371 [BlockingClient network thread for 3r44ddzjitznyahw.onion/<unresolved>:8333] INFO  o.b.w.Wallet: Balance is now: 0.05908071 BTC 
Aug-09 21:41:44.444 [BlockingClient network thread for 3r44ddzjitznyahw.onion/<unresolved>:8333] INFO  o.b.w.Wallet: Received tx for -0.00000023 BTC: ed197cfb468a18aefcee93142a8a63eb08ff6f5c080ea4373ce1ac64344dc94d [1] in block 0000000000000000000c4f397f28ba18acf416127190d66ae2cc2332bd5e4d8b 
Aug-09 21:41:44.444 [BlockingClient network thread for 3r44ddzjitznyahw.onion/<unresolved>:8333] INFO  o.b.w.Wallet:   <-pending 
Aug-09 21:41:44.444 [BlockingClient network thread for 3r44ddzjitznyahw.onion/<unresolved>:8333] INFO  o.b.w.Wallet:   tx ed197cfb468a18aefcee93142a8a63eb08ff6f5c080ea4373ce1ac64344dc94d ->unspent 
Aug-09 21:41:44.518 [BlockingClient network thread for 3r44ddzjitznyahw.onion/<unresolved>:8333] INFO  o.b.w.Wallet: Balance is now: 0.00068658 BTC 
Aug-09 21:41:44.520 [BlockingClient network thread for 3r44ddzjitznyahw.onion/<unresolved>:8333] INFO  o.b.w.WalletFiles: Saving wallet; last seen block is height 695002, date 2021-08-09T19:41:30Z, hash 0000000000000000000c4f397f28ba18acf416127190d66ae2cc2332bd5e4d8b 
</code></pre>
<p>Let me also attach log file where you can find mentions of address bc1qnvwx9xfeh34v4e7tws2ll3fdspjra4uhllwfyu usage, because there are multiple of those:<br>
<a href="https://github.com/bisq-network/bisq/files/6977439/bisq_10.log">bisq_10.log</a></p>
<p>I hope this will help.</p>

<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/issues/5661">view it on GitHub</a>, or <a href="https://github.com/notifications/unsubscribe-auth/AJFFTNSL3U33NERE6JFBHZLT4QBONANCNFSM5CBYLZKA">unsubscribe</a>.<br />Triage notifications on the go with GitHub Mobile for <a href="https://apps.apple.com/app/apple-store/id1477376905?ct=notification-email&mt=8&pt=524675">iOS</a> or <a href="https://play.google.com/store/apps/details?id=com.github.android&utm_campaign=notification-email">Android</a>.<img src="https://github.com/notifications/beacon/AJFFTNVDEZHHSF2WQL42FV3T4QBONA5CNFSM5CBYLZKKYY3PNVWWK3TUL52HS4DFUVEXG43VMWVGG33NNVSW45C7NFSM4OOFWQOQ.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/issues/5661",
"url": "https://github.com/bisq-network/bisq/issues/5661",
"name": "View Issue"
},
"description": "View this Issue on GitHub",
"publisher": {
"@type": "Organization",
"name": "GitHub",
"url": "https://github.com"
}
}
]</script>