sync: use muliterror in ValidateBlock
This commit is contained in:
parent
d9fe9a6ea4
commit
eaddb8abe8
@ -4,6 +4,7 @@ import (
|
|||||||
"context"
|
"context"
|
||||||
"errors"
|
"errors"
|
||||||
"fmt"
|
"fmt"
|
||||||
|
"github.com/hashicorp/go-multierror"
|
||||||
"sync"
|
"sync"
|
||||||
"time"
|
"time"
|
||||||
|
|
||||||
@ -583,13 +584,15 @@ func (syncer *Syncer) ValidateBlock(ctx context.Context, b *types.FullBlock) err
|
|||||||
winnerCheck,
|
winnerCheck,
|
||||||
msgsCheck,
|
msgsCheck,
|
||||||
}
|
}
|
||||||
|
|
||||||
|
var merr error
|
||||||
for _, fut := range await {
|
for _, fut := range await {
|
||||||
if err := fut.AwaitContext(ctx); err != nil {
|
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 {
|
func (syncer *Syncer) checkBlockMessages(ctx context.Context, b *types.FullBlock, baseTs *types.TipSet) error {
|
||||||
|
Loading…
Reference in New Issue
Block a user