nyxpay / nyx

NNOVATIVE and DECENTRALIZED crypto currency
https://www.nyxcoin.org
Other
8 stars 7 forks source link

Accounts are able to have negative balance #1

Open cryptocoinguru opened 6 years ago

cryptocoinguru commented 6 years ago

Accounts should NEVER be able to have a negative balance. This can happen like this:

Account "" has 0.0000 NYX. $>nyx-cli move "" "other-account" 1000

Ends up like this: $> nyx-cli listaccounts { "": -1000.0000000000 "othe-account": 1000.000000000 }

This is "magic" like only fiat banks do... making crappy money out of nothing! This problem happened for real by using: $> nyx-cli sendtoaddress [nyx-address] 1001.00

Crapped up my whole wallet showing negative balances and wrong amounts. Only getbalance was showing correct "total" amount as negative and positive balances of all accounts were correct.

This is a crappy behaving that should not happen! I don't see any reason why zero accounts should be deducted for any transaction. The correct behaviour would be to give an error if trying to use default account "" if it is zero or as less balance. Same for sendfrom command while trying to send coins from given address that has zero or less amount that should be transfered.

In my case this happened while trying to transfer coins between local addresses (masternode setup).