add is permanent
License: MIT Signed-off-by: Jakub Sztandera <kubuxu@protocol.ai>
This commit is contained in:
parent
2b57fd14f1
commit
b3fe304d82
@ -369,6 +369,10 @@ func (syncer *Syncer) Sync(ctx context.Context, maybeHead *types.TipSet) error {
|
|||||||
return nil
|
return nil
|
||||||
}
|
}
|
||||||
|
|
||||||
|
func isPermanent(err error) bool {
|
||||||
|
return !errors.Is(err, ErrTemporal)
|
||||||
|
}
|
||||||
|
|
||||||
func (syncer *Syncer) ValidateTipSet(ctx context.Context, fts *store.FullTipSet) error {
|
func (syncer *Syncer) ValidateTipSet(ctx context.Context, fts *store.FullTipSet) error {
|
||||||
ctx, span := trace.StartSpan(ctx, "validateTipSet")
|
ctx, span := trace.StartSpan(ctx, "validateTipSet")
|
||||||
defer span.End()
|
defer span.End()
|
||||||
@ -380,7 +384,7 @@ func (syncer *Syncer) ValidateTipSet(ctx context.Context, fts *store.FullTipSet)
|
|||||||
|
|
||||||
for _, b := range fts.Blocks {
|
for _, b := range fts.Blocks {
|
||||||
if err := syncer.ValidateBlock(ctx, b); err != nil {
|
if err := syncer.ValidateBlock(ctx, b); err != nil {
|
||||||
if !errors.Is(err, ErrTemporal) {
|
if isPermanent(err) {
|
||||||
syncer.bad.Add(b.Cid())
|
syncer.bad.Add(b.Cid())
|
||||||
}
|
}
|
||||||
return xerrors.Errorf("validating block %s: %w", b.Cid(), err)
|
return xerrors.Errorf("validating block %s: %w", b.Cid(), err)
|
||||||
|
Loading…
Reference in New Issue
Block a user