From 3b163901bb31fd86948debab90eaafc4b7c087fc Mon Sep 17 00:00:00 2001 From: envestcc Date: Mon, 22 Jan 2024 21:18:28 +0800 Subject: [PATCH] address comments --- action/protocol/staking/protocol.go | 5 +---- 1 file changed, 1 insertion(+), 4 deletions(-) diff --git a/action/protocol/staking/protocol.go b/action/protocol/staking/protocol.go index 85940effa8..35dfc223b6 100644 --- a/action/protocol/staking/protocol.go +++ b/action/protocol/staking/protocol.go @@ -494,10 +494,6 @@ func (p *Protocol) isActiveCandidate(ctx context.Context, csr CandidateStateRead if address.Equal(vb.Owner, cand.Owner) { return true, nil } - // bucket is not endorsed to the candidate - if !address.Equal(vb.Candidate, cand.Owner) { - return false, nil - } esr := NewEndorsementStateReader(csr.SR()) endorse, err := esr.Get(cand.SelfStakeBucketIdx) switch { @@ -513,6 +509,7 @@ func (p *Protocol) isActiveCandidate(ctx context.Context, csr CandidateStateRead return false, err default: // endorsement does not exist + return false, errors.New("endorsement does not exist") } return true, nil }