account: disable renewAccount for StatePendingBatch status

If the account is currently participating in a batch
(`StatePendingBatch`) we disable the renewAccount command. After
enabling account autorenew it could be problematic to renew your
account before the batch is confirmed and you account expiry height
gets updated.
This commit is contained in:
positiveblue 2021-11-30 20:30:35 -08:00
parent cb53898136
commit 2e724ad4d6
No known key found for this signature in database
GPG key ID: 4FFF2510928804DC

View file

@ -1212,11 +1212,11 @@ func (m *Manager) RenewAccount(ctx context.Context,
return nil, nil, err
}
switch account.State {
case StateOpen, StatePendingBatch, StateExpired:
case StateOpen, StateExpired:
default:
return nil, nil, fmt.Errorf("account must be in either of %v "+
"to be renewed",
[]State{StateOpen, StatePendingBatch, StateExpired})
[]State{StateOpen, StateExpired})
}
// Validate the new expiry.