Closed str4d closed 1 month ago
After a brief look over the code, I think what's happening is that the change notes that were created under the old rules where the note was sent back to the sending address are not correctly being added to the received_notes
table in the same fashion as are notes that are now sent to the account's internal change address.
Looking at the SQLite database, I see that my sent_notes table contains an output for the new recipient, and the new change note (that my balance increased by), but does not contain any entries for the old change notes (violating the double-entry accounting assumptions now baked into zcash_client_sqlite).
I can reproduce the absence of entries in sent_notes
for notes sent prior to the wallet recovery, but I cannot reproduce the incorrect balance symptom. It's possible that the CLI wallet is doing something unusual (or that the behaviour of zcash_client_sqlite at the base of #908 is different than the revision you were testing with).
This may now be fixed by #1306
Closing as complete.
I have a mainnet wallet in which I have a bunch of transactions, generating a bunch of change, back when we didn't have internal viewing keys. I recovered from seed to set up a new instance of a mobile wallet, and then made a transaction. My balance went up by the value of the change output, instead of decreasing by the value of the sent amount.
Looking at the SQLite database, I see that my
sent_notes
table contains an output for the new recipient, and the new change note (that my balance increased by), but does not contain any entries for the old change notes (violating the double-entry accounting assumptions now baked intozcash_client_sqlite
).