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")
|
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")
|
||||||
}
|
}
|
||||||
|
@ -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
|
||||||
|
|
||||||
|
Loading…
Reference in New Issue
Block a user