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") return nil, xerrors.Errorf("tipset contained different number for beacon entires")
} }
for i, be := range bh.BeaconEntries { 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 // cannot mark bad, I think @Kubuxu
return nil, xerrors.Errorf("tipset contained different beacon entires") return nil, xerrors.Errorf("tipset contained different beacon entires")
} }

View File

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