From 2e724ad4d6a38e2aaed50338f2d7057da2cfcd05 Mon Sep 17 00:00:00 2001 From: positiveblue Date: Tue, 30 Nov 2021 20:30:35 -0800 Subject: [PATCH] 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. --- account/manager.go | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/account/manager.go b/account/manager.go index a14cdfe..63ebeb6 100644 --- a/account/manager.go +++ b/account/manager.go @@ -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.