Rollback DB updates for failed tx publishing. #740
Merged
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
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.