dtr-org / unit-e

A digital currency for a new era of decentralized trust
https://unit-e.io
MIT License
45 stars 15 forks source link

Balance disappears when sending deposit to non whitelisted pubkey #996

Closed kostyantyn closed 5 years ago

kostyantyn commented 5 years ago

Describe the bug When sending a deposit to non whitelisted pubkey, I receive a very vague error, and the whole balance becomes 0.

To Reproduce

➜  unit-e git:(master) ✗ ./src/unit-e-cli --datadir=./testnet/ getnewaddress '' 'legacy'
n43kvvR5cGsJmmYpVFgtjWKckoCwQuK99s
unit-e git:(master) ✗ ./src/unit-e-cli --datadir=./testnet/ getbalance
10000000.00000000
➜  unit-e git:(master) ✗ ./src/unit-e-cli --datadir=./testnet/ deposit n43kvvR5cGsJmmYpVFgtjWKckoCwQuK99s 10000

error code: -25
error message:
Cannot create deposit.
➜  unit-e git:(master) ✗ ./src/unit-e-cli --datadir=./testnet/ getbalance
0.00000000

Expected behavior I'd expect to receive a proper message that my pubkey is not whitelisted and balance stays unchanged.

Additional information Restarting the node helps to recover the balance.

Ruteri commented 5 years ago

This happens in general when a commit is wrong, for example when the amount is wrong or the node doesn't have enough funds. Also happens with admin commands.