Verify PrevRound too

Signed-off-by: Jakub Sztandera <kubuxu@protocol.ai>
This commit is contained in:
Jakub Sztandera 2020-04-14 16:18:34 +02:00
parent 3e976fd74b
commit 624dd7d2ce

View File

@ -999,7 +999,8 @@ func (syncer *Syncer) collectHeaders(ctx context.Context, from *types.TipSet, to
return nil, xerrors.Errorf("tipset contained different number for beacon entires")
}
for i, be := range bh.BeaconEntries {
if targetBE[i].Round != be.Round || !bytes.Equal(targetBE[i].Data, be.Data) {
if targetBE[i].Round != be.Round || !bytes.Equal(targetBE[i].Data, be.Data) ||
targetBE[i].PrevRound() != be.PrevRound() {
// cannot mark bad, I think @Kubuxu
return nil, xerrors.Errorf("tipset contained different beacon entires")
}