remove usage of previous round in beacon entries
This commit is contained in:
parent
59dcbe93a4
commit
931a862abc
@ -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")
|
||||
}
|
||||
|
@ -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
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user