Skip to content

Commit d21dac5

Browse files
committed
x
1 parent ed80bd7 commit d21dac5

File tree

1 file changed

+7
-2
lines changed

1 file changed

+7
-2
lines changed

action/protocol/staking/protocol.go

+7-2
Original file line numberDiff line numberDiff line change
@@ -468,9 +468,14 @@ func (p *Protocol) ReadState(ctx context.Context, sr protocol.StateReader, metho
468468
case iotexapi.ReadStakingDataMethod_TOTAL_STAKING_AMOUNT:
469469
//if p.archiveMode && inputHeight < p.hu.GreenlandBlockHeight() && inputHeight >= p.hu.FairbankBlockHeight() {
470470
if p.archiveMode && inputHeight < p.hu.GreenlandBlockHeight() && inputHeight >= 5160000 {
471-
resp, height, err = p.candBucketsIndexer.GetStakingBalance(inputHeight)
471+
if p.candBucketsIndexer != nil {
472+
resp, height, err = p.candBucketsIndexer.GetStakingBalance(inputHeight)
473+
} else {
474+
resp, height, err = readStateTotalStakingAmount(ctx, csr, r.GetTotalStakingAmount())
475+
}
476+
472477
//if err != nil {
473-
// resp, height, err = readStateTotalStakingAmount(ctx, csr, r.GetTotalStakingAmount())
478+
//
474479
//}
475480
} else {
476481
resp, height, err = readStateTotalStakingAmount(ctx, csr, r.GetTotalStakingAmount())

0 commit comments

Comments
 (0)