-
Notifications
You must be signed in to change notification settings - Fork 1.2k
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
fix: unlock proregtx collateral on error #5838
Conversation
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
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.
Mostly looks good; a few nits; and one concern around naked throw?
SignSpecialTxPayloadByString(tx, ptx, key); | ||
SetTxPayload(tx, ptx); | ||
return SignAndSendSpecialTx(request, chainman, tx, fSubmit); | ||
throw; |
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.
why is there a naked throw?
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.
bcs need to re-throw the exception which has been caught by except
without changing logic of code. If throw is naked - it throws the last exception again.
But I'd suggest to write here a wrapper around Lock/Unlock same as 'lock_guard + mutex works'.
When creating a proregtx unlock the external collateral if creation fails
4faaf09
to
8f09b4e
Compare
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
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
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 for squash merge
Issue being fixed
Unlock the (external) collateral of a proregtx if creation fails for any reason.
What was done?
See commit description
Checklist: