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

vspclient: More fixes for vsp fee confirmation tracking #2048

Merged
merged 5 commits into from May 10, 2021

Conversation

alexlyp
Copy link
Member

@alexlyp alexlyp commented May 7, 2021

This includes the following fixes for vspClient tracking:

  • Schedule all fee payments for reconcile payment, regardless of fee tx status.
  • Remove unvotable tickets from jobs and attempt to revoke tickets
  • Catch signature errors from SignTransaction attempt
  • Handle payfee error for expired fee tx from vspd. Abandon current fee tx and then retry to make a fresh one.

log.Errorf("cannot revoke vsp tickets %v", err)
}
} else {
log.Errorf("cannot revoke ticket since SPV mode")
Copy link
Member

Choose a reason for hiding this comment

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

we can remove this entirely or perhaps make it a debug log; this isn't an error.

Comment on lines 740 to 741
if errors.As(err, &apiErr) {
if apiErr.Code == codeTicketCannotVote {
Copy link
Member

Choose a reason for hiding this comment

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

we can drop an indent by combining these if statements:

if errors.As(err, &apiErr) && apiErr.Code == codeTicketCannotVote

Comment on lines 896 to 897
if errors.As(err, &apiErr) {
if apiErr.Code == codeFeeExpired {
Copy link
Member

Choose a reason for hiding this comment

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

see above

log.Errorf("error abandoning expired fee tx %v", err)
}
fp.feeTx = nil
fp.submitPayment()
Copy link
Member

Choose a reason for hiding this comment

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

I don't like calling submitPayment from itself, since this perhaps has the possibility to recurse endlessly (and slowly because of the api call) until it eventually stack overflows. Can we just return an error and let the caller deal with it?

Copy link
Member

Choose a reason for hiding this comment

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

clearing the fee tx is still correct though, but we should just let the caller deal with recreating and resubmitting it.

@jrick jrick merged commit 0cab091 into decred:master May 10, 2021
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.

None yet

2 participants