Fix edgecase in tipset skipcache
This commit is contained in:
parent
21b4741e30
commit
10b931312b
@ -107,6 +107,9 @@ func (ci *ChainIndex) fillCache(tsk types.TipSetKey) (*lbEntry, error) {
|
||||
}
|
||||
|
||||
rheight -= ci.skipLength
|
||||
if rheight < 0 {
|
||||
rheight = 0
|
||||
}
|
||||
|
||||
var skipTarget *types.TipSet
|
||||
if parent.Height() < rheight {
|
||||
|
@ -895,6 +895,7 @@ func TestSyncCheckpointEarlierThanHead(t *testing.T) {
|
||||
func TestDrandNull(t *testing.T) {
|
||||
H := 10
|
||||
v5h := abi.ChainEpoch(50)
|
||||
ov5h := build.UpgradeHyperdriveHeight
|
||||
build.UpgradeHyperdriveHeight = v5h
|
||||
tu := prepSyncTestWithV5Height(t, H, v5h)
|
||||
|
||||
@ -942,4 +943,6 @@ func TestDrandNull(t *testing.T) {
|
||||
require.NoError(t, err)
|
||||
|
||||
require.Equal(t, []byte(rand), expectedRand)
|
||||
build.UpgradeHyperdriveHeight = ov5h
|
||||
|
||||
}
|
||||
|
Loading…
Reference in New Issue
Block a user