remove usage of previous round in beacon entries

This commit is contained in:
Jeromy 2020-04-30 11:39:37 -07:00
parent 59dcbe93a4
commit 931a862abc
2 changed files with 4 additions and 12 deletions

View File

@ -974,8 +974,7 @@ 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) ||
targetBE[i].PrevRound() != be.PrevRound() {
if targetBE[i].Round != be.Round || !bytes.Equal(targetBE[i].Data, be.Data) {
// cannot mark bad, I think @Kubuxu
return nil, xerrors.Errorf("tipset contained different beacon entires")
}

View File

@ -29,22 +29,15 @@ type ElectionProof struct {
type BeaconEntry struct {
Round uint64
Data []byte
prevRound uint64
}
func NewBeaconEntry(round, prevRound uint64, data []byte) BeaconEntry {
func NewBeaconEntry(round uint64, data []byte) BeaconEntry {
return BeaconEntry{
Round: round,
Data: data,
prevRound: prevRound,
Round: round,
Data: data,
}
}
func (be *BeaconEntry) PrevRound() uint64 {
return be.prevRound
}
type BlockHeader struct {
Miner address.Address // 0