Skip to content

Commit 1d6c485

Browse files
committed
x
1 parent 02b615d commit 1d6c485

File tree

1 file changed

+4
-1
lines changed

1 file changed

+4
-1
lines changed

action/protocol/staking/protocol.go

+4-1
Original file line numberDiff line numberDiff line change
@@ -474,8 +474,11 @@ func (p *Protocol) ReadState(ctx context.Context, sr protocol.StateReader, metho
474474
case iotexapi.ReadStakingDataMethod_CANDIDATE_BY_ADDRESS:
475475
resp, height, err = readStateCandidateByAddress(ctx, csr, r.GetCandidateByAddress())
476476
case iotexapi.ReadStakingDataMethod_TOTAL_STAKING_AMOUNT:
477-
if p.archiveMode && p.hu.IsPre(config.Greenland, height) {
477+
if p.archiveMode && p.hu.IsPre(config.Greenland, inputHeight) {
478478
resp, height, err = readStateTotalStakingAmountFromIndexer(sr, r.GetTotalStakingAmount(), inputHeight)
479+
if err != nil {
480+
resp, height, err = readStateTotalStakingAmount(ctx, csr, r.GetTotalStakingAmount())
481+
}
479482
} else {
480483
resp, height, err = readStateTotalStakingAmount(ctx, csr, r.GetTotalStakingAmount())
481484
}

0 commit comments

Comments
 (0)