mark bad should be respected for every incoming tipset

This commit is contained in:
whyrusleeping 2020-02-06 22:39:24 -08:00
parent 44c1e3a347
commit d4338047af

View File

@ -118,6 +118,10 @@ func (syncer *Syncer) InformNewHead(from peer.ID, fts *store.FullTipSet) bool {
}
for _, b := range fts.Blocks {
if syncer.bad.Has(b.Cid()) {
log.Warnf("InformNewHead called on block marked as bad: %s", b.Cid())
return false
}
if err := syncer.ValidateMsgMeta(b); err != nil {
log.Warnf("invalid block received: %s", err)
return false