Merge pull request #1233 from filecoin-project/fix/mark-bad

mark bad should be respected for every incoming tipset
This commit is contained in:
Łukasz Magiera 2020-02-07 07:42:01 +01:00 committed by GitHub
commit 17c3d158d2
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

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