Veil-Project / veil

Veil-Project
MIT License
117 stars 91 forks source link

When sending ringct the balance is incorrect until rescanringctwallet is done after the tx gets included in a block. #987

Open seanPhill opened 2 years ago

seanPhill commented 2 years ago

Every spend left a detected balance that did not account for all of the spent utxos, and which was only corrected after the first confirmation, by doing rescanringctwallet. (quoted from my comment on an issue recommending that rescanringctwallet be invoked automatically by the wallet at certain times — Issue #922 )

This was noticed when I had a large amount of Veil in RingCT to transfer from an old wallet to a new one. It occurred in a sending wallet using the new release 1.2.3.1 as well as one running a recent Github Actions master build.

us77ipis commented 2 years ago

I just had a similar issue, when using sendbasecointostealth from one wallet to another. In the source wallet all my coins disappeared and in the transaction history it appeared correctly. However, on the receiving wallet, it showed only the fee (thus a negative value) without the actual coins I transfered. After a rescanringctwallet the balance updated and is now correct, but the transaction history is still wrong and shows only the fee, my coins are completely missing in the transaction history.

seanPhill commented 2 years ago

It's not showing "the fee", when a stealth transaction arrives in a locked wallet, but a placeholder of a satoshi or two. rescanringctwallet will quickly detect the missing amounts. I would like that to be automatically triggered in the wallet when it is syncing. This is the reason that the one exchange that began to allow stealth withdrawals in early 2019 changed back to only basecoin withdrawals (and deposits), as customers contacted the exchange support saying they didn't get their correct funds. rescanringctwallet only takes seconds, but it is maybe a good idea to unlock your wallet when syncing, and it will find the correct, received amounts in the first place. When you're sending funds from basecoin to stealth people don't notice this issue, as your wallet is already unlocked to send the funds. When receiving from a third party you've got to remember to unlock, in order to read what can't be seen without the wallet's private keys.

us77ipis commented 2 years ago

Probably the following should be implemented:

  1. When wallet is unlocked auto rescanringctwallet
  2. rescanringctwallet must update the transaction history too.
  3. I would also prefer to see in the transaction history something like unknown instead of a -0.00000002. Maybe with a question mark on the side that when you hover shows a message "Please unlock wallet first" or something like that.