PIVX-Project / PIVX

Protected Instant Verified Transactions - Core wallet.
https://www.pivx.org
MIT License
528 stars 716 forks source link

[Bug][GUI] Shielded UTXOs are getting locked randomly and becoming unavailable for manual selection through Coin Control #2660

Closed ambassador000 closed 2 years ago

ambassador000 commented 2 years ago

v5.4.0rc1 (happens on earlier versions as well)

PR #2593 didn't fix the issue, it is still happening. It happens on mainnet and it's impossible to write down exact steps to reproduce, but it happens randomly when doing transactions from own shielded and transparent addresses (when there is a change left) back and forth or between shielded addresses (when there's change left as well).

NOTE: It is just a GUI bug from Coin Control, UTXOs cannot be manually selected or by clicking Select All. Unlock unspent also doesn't work. However, by sending the transaction without using Coin Control, it is possible to normally spend these locked UTXOs, but they will be used the latest after all the unlocked shielded UTXOs get spent.

lockedShieldUTXOs01

random-zebra commented 2 years ago

Can confirm this. Nice find. Thanks @ambassador000

Steps to reproduce:

  1. Make a transaction with one transparent output and one shield output (e.g. a shielding tx with change)
  2. Permanently lock the first transparent output. E.g. using it as collateral in masternode.conf or via RPC: lockunspent false "[{\"txid\":\"the hash of the tx made in 1\",\"vout\":0}]"
  3. The first shield note (with the same index of the transparent out locked, 0 in this case) will also appear locked in coin control, besides the transparent coin (which is locked for real: it cannot be spent).

Fixed by #2661