augment current epoch by +1

to account for off by one conditions
This commit is contained in:
vyzo 2021-06-17 13:49:14 +03:00
parent 933c786421
commit b7897595eb

View File

@ -490,7 +490,7 @@ func (s *SplitStore) updateWriteEpoch() {
dt := time.Since(timestamp) dt := time.Since(timestamp)
if dt < 0 { if dt < 0 {
writeEpoch := curTs.Height() writeEpoch := curTs.Height() + 1
if writeEpoch > s.writeEpoch { if writeEpoch > s.writeEpoch {
s.writeEpoch = writeEpoch s.writeEpoch = writeEpoch
} }
@ -498,7 +498,7 @@ func (s *SplitStore) updateWriteEpoch() {
return return
} }
writeEpoch := curTs.Height() + abi.ChainEpoch(dt.Seconds())/builtin.EpochDurationSeconds writeEpoch := curTs.Height() + abi.ChainEpoch(dt.Seconds())/builtin.EpochDurationSeconds + 1
if writeEpoch > s.writeEpoch { if writeEpoch > s.writeEpoch {
s.writeEpoch = writeEpoch s.writeEpoch = writeEpoch
} }