Skip to content
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

Rollback DB updates for failed tx publishing. #740

Merged
merged 1 commit into from
May 17, 2017

Conversation

jrick
Copy link
Member

@jrick jrick commented May 15, 2017

This change improves the transaction creation error handling to handle
failures for rejected transactions or errors storing a transaction
into the database. When purchasing tickets (a task that requires
creating multiple transactions), a DB update is now opened for each
published transaction.

The code has also been improved to only open DB updates when storing
or publishing the transaction. Views are used when authoring and
signing transactions. This reduces the amount of time spent in the
update and should improve the performance characteristics of the
wallet.

In the future, transactions could be published outside of the update,
but this will require a second update to remove any stored
transactions if the send fails. This can not be done at this time due
to missing the udb APIs to remove these transactions.

@jrick jrick changed the title Roll back DB updates for failed tx publishing. Rollback DB updates for failed tx publishing. May 15, 2017
Copy link
Contributor

@jolan jolan left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Looks good/makes sense to me.

Tested as well as I could trying to jam the wallet with a mix of automated ticketbuying and manual purchaseticket calls.

No problems encountered with my normal wallet usage (automatic ticket buying on testnet).

OK

This change improves the transaction creation error handling to handle
failures for rejected transactions or errors storing a transaction
into the database.  When purchasing tickets (a task that requires
creating multiple transactions), a DB update is now opened for each
published transaction.

The code has also been improved to only open DB updates when storing
or publishing the transaction.  Views are used when authoring and
signing transactions.  This reduces the amount of time spent in the
update and should improve the performance characteristics of the
wallet.

In the future, transactions could be published outside of the update,
but this will require a second update to remove any stored
transactions if the send fails.  This can not be done at this time due
to missing the udb APIs to remove these transactions.
@jrick jrick merged commit caa9c13 into decred:master May 17, 2017
@jrick jrick deleted the safepublishing branch May 17, 2017 16:12
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants