Skip to content

Commit

Permalink
[release-v1.8] vsp: Dont ignore locked wallet errs
Browse files Browse the repository at this point in the history
Users should be warned if an error is caused by a locked wallet so they
can remediate the problem. VSP fee payments may be missed if these
errors are suppressed, and the tickets won't be voted.

Partial backport of 2c0284a
  • Loading branch information
jholdstock committed Aug 8, 2023
1 parent e71decb commit 1c1bcfb
Showing 1 changed file with 5 additions and 7 deletions.
12 changes: 5 additions & 7 deletions internal/vsp/feepayment.go
Expand Up @@ -248,10 +248,9 @@ func (c *Client) feePayment(ctx context.Context, ticketHash *chainhash.Hash, pai
log.Errorf("%v is not a ticket: %v", ticketHash, err)
return nil
}
// Try to access the voting key, ignore error unless the wallet is
// locked.
// Try to access the voting key.
fp.votingKey, err = w.DumpWIFPrivateKey(ctx, fp.votingAddr)
if err != nil && !errors.Is(err, errors.Locked) {
if err != nil {
log.Errorf("no voting key for ticket %v: %v", ticketHash, err)
return nil
}
Expand Down Expand Up @@ -865,11 +864,10 @@ func (fp *feePayment) confirmPayment() (err error) {
}()

status, err := fp.client.status(ctx, &fp.ticketHash)
// Suppress log if the wallet is currently locked.
if err != nil && !errors.Is(err, errors.Locked) {
log.Warnf("Rescheduling status check for %v: %v", &fp.ticketHash, err)
}
if err != nil {

log.Warnf("Rescheduling status check for %v: %v", &fp.ticketHash, err)

// Stop processing if the status check cannot be performed, but
// a significant amount of confirmations are observed on the fee
// transaction.
Expand Down

0 comments on commit 1c1bcfb

Please sign in to comment.