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

fix: unlock proregtx collateral on error #5838

Merged
merged 1 commit into from
Feb 8, 2024

Conversation

panleone
Copy link

@panleone panleone commented Jan 21, 2024

Issue being fixed

Unlock the (external) collateral of a proregtx if creation fails for any reason.

What was done?

See commit description

Checklist:

  • I have performed a self-review of my own code
  • I have commented my code, particularly in hard-to-understand areas
  • I have added or updated relevant unit/integration/functional/e2e tests
  • I have made corresponding changes to the documentation
  • I have assigned this pull request to a milestone

@knst knst added this to the 20.1 milestone Jan 21, 2024
UdjinM6
UdjinM6 previously approved these changes Jan 22, 2024
Copy link

@UdjinM6 UdjinM6 left a comment

Choose a reason for hiding this comment

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

utACK

src/rpc/evo.cpp Outdated Show resolved Hide resolved
Copy link
Member

@PastaPastaPasta PastaPastaPasta left a 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?

src/rpc/evo.cpp Outdated Show resolved Hide resolved
SignSpecialTxPayloadByString(tx, ptx, key);
SetTxPayload(tx, ptx);
return SignAndSendSpecialTx(request, chainman, tx, fSubmit);
throw;
Copy link
Member

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?

Copy link
Collaborator

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'.

src/rpc/evo.cpp Show resolved Hide resolved
When creating a proregtx unlock the external collateral if creation fails
Copy link
Collaborator

@knst knst left a comment

Choose a reason for hiding this comment

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

utACK

Copy link

@UdjinM6 UdjinM6 left a comment

Choose a reason for hiding this comment

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

utACK

Copy link
Member

@PastaPastaPasta PastaPastaPasta left a 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

@PastaPastaPasta PastaPastaPasta merged commit 8ea9c40 into dashpay:develop Feb 8, 2024
8 of 10 checks passed
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.

4 participants