Closed us77ipis closed 2 years ago
The current changes of the PR already work and solve the problem. However, it is still marked as draft because currently when the wallet is unlocked it does the full rescanringctwallet
in the UI thread, which I don't think is a good idea. We could do one of the following things (or both?) to optimize this:
rescanringctwallet
in another thread, when the wallet is unlocked.rescanringctwallet
, but instead keep track of "locked" transactions and then only specifically rescan those when the wallet is unlocked.Btw. what will the bounty be for solving this soon three year old issue with as far as I can read in #922 quite high impact for Veil users :wink: ?
Just noticed it still doesn't work if the user unlocks the wallet while the transaction is still unconfirmed.
I've got this PR running on Testnet, and firstly ran the released standard released version, to compare, but this time, unlocking has so far taken 2.5 hours, and is continuing to show the macOS beach ball of waiting, and no progress in the debug log. :( Admittedly, this wallet is normally slow (because the wallet.dat file is moderately large, and it has done a huge number of stakes and spends), but not like this. I have been able to rescanringctwallet with no problem, but with PR1001 it's just not completing. This is programmed to only do a single rescanringctwallet upon unlock, right?
There was probably at least thirty or forty CT (from incoming zerocoin spends) incoming transactions that had not got a value except for "0.00000001" (as displayed on the released version), and "0.00000000" when opened in PR1001.
The beachball of waiting is invisible in the screenshot, but it is still there.
That sounds like a locking issue. I think I forgot to lock also cs_main
. @seanPhill Please try again with the changes I just pushed.
There was probably at least thirty or forty CT (from incoming zerocoin spends) incoming transactions that had not got a value except for "0.00000001" (as displayed on the released version), and "0.00000000" when opened in PR1001.
That's the expected behavior for transactions that had already arrived before. For the "Hidden" text to be displayed the transaction has to have income through the wallet that has the changes of this PR. However, once you unlock the wallet (and it doesn't hang up) also the old "0.00000000" values should be replaced by the correct ones.
Tested a second time with the changes at the point in time of my thumbs up above.
Fully worked as expected. This wallet took just a few minutes, but a smaller wallet would have been quicker.
This PR is now ready for extensive testing and review.
I don't know how the translation stuff currently works. Since I added the new strings "Hidden" and "Unlock wallet to see hidden amount", should some translations be added? If yes, how exactly is that handled?
I just had an issue with this function tonight. [Don't know if this is related to the requested changes.]
While it has normally worked fine for me, my testnet wallet had been locked (and / or closed) and receiving a lot of transactions for about twenty hours, and maybe I unlocked it a bit soon after starting it up, but when I did, the transactions this time did not correct themselves. I was still getting the mouseover message about needing to unlock to see the correct amounts. I waited a few minutes, and tried locking the wallet again and unlocking it again, and it still did not correct the transactions list. ... I then manually did rescanringctwallet
, and it promptly fixed all the amounts.
This is a wallet with over 55,000 transaction rows in the course of twenty days from fresh seed. The issue was with the 62 received CT amounts over the course of 20 hours, while the wallet was either locked or turned off.
[Don't know if this is related to the requested changes.]
I already pushed the requested changes (and marked them as solved), don't know why it still shows "Changes requested".
I then manually did rescanringctwallet, and it promptly fixed all the amounts.
If full rescanringctwallet
worked, then that is an issue with the optimization, thus for whatever reason those transactions didn't get tracked as locked transactions.
I've retested with the wallet again, with a few days of transactions to reveal. No problem. With a day's worth of transactions synced while locked, and still more than a day of transactions left to sync, when unlocked, it revealed the amounts and continued syncing, no problem. Closed the wallet, and restarted with more than a day of transactions to sync, and then syncing completely while locked, when unlocked, it worked as per normal, the transactions were revealed over no more than three seconds, and everything was fine.
That failure a few days ago I will have to consider an anomaly that might not ever happen to anyone without such a large wallet as my test wallet. Could not be reproduced, and the solution was very simple anyway (rescanringctwallet
).
@Zannick can you confirm that your requested changes have been made? ... -> code review. Everything should be ready.
utACK 6333d875984d0cecaceefa6d2f7a830755274a44
This PR solves the issue that caused an exchange in early 2019 to reverse their decision to allow stealth withdrawals. I hope that this PR can be included in the next release, which will enable exchanges to enable stealth withdrawals. @codeofalltrades
Problem
When receiving a CT transaction while the wallet is locked (or unlocked for staking only), the amount displayed in the transaction history is wrong, and keeps wrong until a
rescanringctwallet
rpc is called and the wallet is restarted.Root Cause
ORF_OWNED
flag was not set correctly, leading to RingCT transactions being showed as "(n/a)" in the transaction history, if they arrived while the wallet was locked.Solution
rescanringctwallet
to properly update corresponding entries in the transaction history GUI.rescanringctwallet
which only rescans those tracked locked transactions, and thus should be fast also for wallets having a very long transaction history.Bounty Payment Address
sv1qqpjsrc60t60jhaywj5krmwla52ska70twc7wun6qnee65guxhvtxegpqwhuxypra4jn3pq86s24ryltcw6g2ss4573hyqac9u4g23m9mvxpyqqqwny49k
Testing Results
Fixes #922, #668