-
Notifications
You must be signed in to change notification settings - Fork 15
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Validate deposit prior adding to the wallet #1040
Conversation
At the moment, when a user prepares deposit, the node creates a transaction and adds it to the wallet. It, in turn, tries to accept it to the memory pool and could fail when the deposit is invalid (for example validator is blacklisted). That leads to disappearing of the deposit from the balance. This commit fixes that by validating deposit before adding transaction to the wallet. Fixes dtr-org#996. Signed-off-by: Stanislav Frolov <stanislav@thirdhash.com>
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
utACK 2ee0f9c
This code change looks alright to me, but I am wondering: The whole balance thing is a tricky thing, once I spend some UTXO they are deduced from my balance. Yet they might not be included in the blockchain actually yet, so they are not really spend. So I am wondering it there should be some sort of "in flight balance", like something which one owns but which has not been included in the blockchain yet. The thoughts that led me here are: It strikes me as odd that anything which has not been confirmed yet (included in the blockchain, possibly even finalized) alters any numbers; but of course it makes sense for the wallet as a user should not create a transaction form balance which she already attempted to spend, true. So maybe some "there but not really there" would be appropriate. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
utACK 2ee0f9c
There is a |
At the moment, when a user prepares deposit, the node creates a transaction and adds it to the
wallet. It, in turn, tries to accept it to the memory pool and could fail when the deposit is
invalid (for example validator is blacklisted). That leads to disappearing of the deposit from the
balance.
This commit fixes that by validating deposit before adding transaction to the wallet.
Fixes #996.