sync: use muliterror in ValidateBlock

This commit is contained in:
Łukasz Magiera 2019-11-11 20:30:49 +01:00
parent d9fe9a6ea4
commit eaddb8abe8

View File

@ -4,6 +4,7 @@ import (
"context"
"errors"
"fmt"
"github.com/hashicorp/go-multierror"
"sync"
"time"
@ -583,13 +584,15 @@ func (syncer *Syncer) ValidateBlock(ctx context.Context, b *types.FullBlock) err
winnerCheck,
msgsCheck,
}
var merr error
for _, fut := range await {
if err := fut.AwaitContext(ctx); err != nil {
return err
err = multierror.Append(merr, err)
}
}
return nil
return merr
}
func (syncer *Syncer) checkBlockMessages(ctx context.Context, b *types.FullBlock, baseTs *types.TipSet) error {