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
Conversation
internal/vsp/feepayment.go
Outdated
log.Errorf("cannot revoke vsp tickets %v", err) | ||
} | ||
} else { | ||
log.Errorf("cannot revoke ticket since SPV mode") |
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.
we can remove this entirely or perhaps make it a debug log; this isn't an error.
internal/vsp/feepayment.go
Outdated
if errors.As(err, &apiErr) { | ||
if apiErr.Code == codeTicketCannotVote { |
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.
we can drop an indent by combining these if statements:
if errors.As(err, &apiErr) && apiErr.Code == codeTicketCannotVote
internal/vsp/feepayment.go
Outdated
if errors.As(err, &apiErr) { | ||
if apiErr.Code == codeFeeExpired { |
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.
see above
internal/vsp/feepayment.go
Outdated
log.Errorf("error abandoning expired fee tx %v", err) | ||
} | ||
fp.feeTx = nil | ||
fp.submitPayment() |
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.
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?
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.
clearing the fee tx is still correct though, but we should just let the caller deal with recreating and resubmitting it.
This includes the following fixes for vspClient tracking: