Skip to content

Commit 663df04

Browse files
committed
x
1 parent 1d6c485 commit 663df04

File tree

1 file changed

+3
-3
lines changed

1 file changed

+3
-3
lines changed

action/protocol/staking/protocol.go

+3-3
Original file line numberDiff line numberDiff line change
@@ -221,7 +221,7 @@ func (p *Protocol) CreatePreStates(ctx context.Context, sm protocol.StateManager
221221
hu := config.NewHeightUpgrade(&bcCtx.Genesis)
222222
fmt.Println("CreatePreStates///////", blkCtx.BlockHeight, p.hu.FairbankBlockHeight(), p.hu.GreenlandBlockHeight())
223223
if p.archiveMode && p.hu.IsPre(config.Greenland, blkCtx.BlockHeight) {
224-
if err := p.saveStakingAddressHistory(blkCtx.BlockHeight, sm); err != nil {
224+
if err := p.saveStakingAddressHistory(blkCtx.BlockHeight-1, sm); err != nil {
225225
fmt.Println("saveStakingAddressHistory errrrr", err)
226226
return err
227227
}
@@ -271,8 +271,8 @@ func (p *Protocol) saveStakingAddressHistory(height uint64, sm protocol.StateMan
271271
if balance.amount.Sign() <= 0 {
272272
return nil
273273
}
274-
hei := byteutil.Uint64ToBytesBigEndian(height - 1)
275-
//hei := byteutil.Uint64ToBytesBigEndian(height)
274+
//hei := byteutil.Uint64ToBytesBigEndian(height - 1)
275+
hei := byteutil.Uint64ToBytesBigEndian(height)
276276
historyKey := append(bucketPoolAddrKey, hei...)
277277
fmt.Println("saveStakingAddressHistory2", height, hex.EncodeToString(historyKey), balance.amount)
278278

0 commit comments

Comments
 (0)