darkwallet/darkwallet — pull request #145 by sczi (2014-06-17 04:32:56+00:00)
Title: don't allow transactions with negative amounts or negative fee

A sane user won't be trying to send negative transactions, but the wallet shouldn't let them anyway. Also transactions with negative amounts mess up the wallet balance.
I think what happens with the wallet balance is the utxo used in the transaction is seen as spent and subtracted from the unconfirmed amount, but it never sees the change coming back from the invalid negative transaction, so that's not added to the unconfirmed and the wallet balance is too low. Then when it finally times out and calls undo that messes up the balance more. But I don't think that needs separate fixing because as long as darkwallet isn't trying to send invalid transactions it shouldn't be a problem?