@@ -220,7 +220,7 @@ func (p *Protocol) CreatePreStates(ctx context.Context, sm protocol.StateManager
220
220
blkCtx := protocol .MustGetBlockCtx (ctx )
221
221
hu := config .NewHeightUpgrade (& bcCtx .Genesis )
222
222
fmt .Println ("CreatePreStates///////" , blkCtx .BlockHeight , p .hu .FairbankBlockHeight (), p .hu .GreenlandBlockHeight ())
223
- if p .archiveMode && p .hu .IsPre ( config . Greenland , blkCtx . BlockHeight ) && blkCtx .BlockHeight > 1 {
223
+ if p .archiveMode && blkCtx . BlockHeight <= p .hu .GreenlandBlockHeight ( ) && blkCtx .BlockHeight > 1 {
224
224
if err := p .saveStakingAddressHistory (blkCtx .BlockHeight , sm ); err != nil {
225
225
fmt .Println ("saveStakingAddressHistory errrrr" , err )
226
226
return err
@@ -475,7 +475,7 @@ func (p *Protocol) ReadState(ctx context.Context, sr protocol.StateReader, metho
475
475
case iotexapi .ReadStakingDataMethod_CANDIDATE_BY_ADDRESS :
476
476
resp , height , err = readStateCandidateByAddress (ctx , csr , r .GetCandidateByAddress ())
477
477
case iotexapi .ReadStakingDataMethod_TOTAL_STAKING_AMOUNT :
478
- if p .archiveMode && p .hu .IsPre ( config . Greenland , inputHeight ) {
478
+ if p .archiveMode && inputHeight <= p .hu .GreenlandBlockHeight ( ) {
479
479
resp , height , err = readStateTotalStakingAmountFromIndexer (sr , r .GetTotalStakingAmount (), inputHeight )
480
480
//if err != nil {
481
481
// resp, height, err = readStateTotalStakingAmount(ctx, csr, r.GetTotalStakingAmount())
0 commit comments