Merge pull request #10836 from filecoin-project/mikers/messagepool/nitfix2
style: mempool: chain errors using xerrors.Errorf
This commit is contained in:
commit
49e1910050
@ -70,8 +70,7 @@ func (mp *MessagePool) CheckReplaceMessages(ctx context.Context, replace []*type
|
|||||||
msgMap[m.From] = mmap
|
msgMap[m.From] = mmap
|
||||||
mset, ok, err := mp.getPendingMset(ctx, m.From)
|
mset, ok, err := mp.getPendingMset(ctx, m.From)
|
||||||
if err != nil {
|
if err != nil {
|
||||||
log.Warnf("errored while getting pending mset: %w", err)
|
return nil, xerrors.Errorf("errored while getting pending mset: %w", err)
|
||||||
return nil, err
|
|
||||||
}
|
}
|
||||||
if ok {
|
if ok {
|
||||||
count += len(mset.msgs)
|
count += len(mset.msgs)
|
||||||
@ -154,8 +153,7 @@ func (mp *MessagePool) checkMessages(ctx context.Context, msgs []*types.Message,
|
|||||||
mp.lk.RLock()
|
mp.lk.RLock()
|
||||||
mset, ok, err := mp.getPendingMset(ctx, m.From)
|
mset, ok, err := mp.getPendingMset(ctx, m.From)
|
||||||
if err != nil {
|
if err != nil {
|
||||||
log.Warnf("errored while getting pending mset: %w", err)
|
return nil, xerrors.Errorf("errored while getting pending mset: %w", err)
|
||||||
return nil, err
|
|
||||||
}
|
}
|
||||||
if ok && !interned {
|
if ok && !interned {
|
||||||
st = &actorState{nextNonce: mset.nextNonce, requiredFunds: mset.requiredFunds}
|
st = &actorState{nextNonce: mset.nextNonce, requiredFunds: mset.requiredFunds}
|
||||||
|
@ -749,8 +749,7 @@ func (mp *MessagePool) checkMessage(ctx context.Context, m *types.SignedMessage)
|
|||||||
}
|
}
|
||||||
|
|
||||||
if err := mp.VerifyMsgSig(m); err != nil {
|
if err := mp.VerifyMsgSig(m); err != nil {
|
||||||
log.Warnf("signature verification failed: %s", err)
|
return xerrors.Errorf("signature verification failed: %s", err)
|
||||||
return err
|
|
||||||
}
|
}
|
||||||
|
|
||||||
return nil
|
return nil
|
||||||
@ -969,13 +968,11 @@ func (mp *MessagePool) addLocked(ctx context.Context, m *types.SignedMessage, st
|
|||||||
}
|
}
|
||||||
|
|
||||||
if _, err := mp.api.PutMessage(ctx, m); err != nil {
|
if _, err := mp.api.PutMessage(ctx, m); err != nil {
|
||||||
log.Warnf("mpooladd cs.PutMessage failed: %s", err)
|
return xerrors.Errorf("mpooladd cs.PutMessage failed: %s", err)
|
||||||
return err
|
|
||||||
}
|
}
|
||||||
|
|
||||||
if _, err := mp.api.PutMessage(ctx, &m.Message); err != nil {
|
if _, err := mp.api.PutMessage(ctx, &m.Message); err != nil {
|
||||||
log.Warnf("mpooladd cs.PutMessage failed: %s", err)
|
return xerrors.Errorf("mpooladd cs.PutMessage failed: %s", err)
|
||||||
return err
|
|
||||||
}
|
}
|
||||||
|
|
||||||
// Note: If performance becomes an issue, making this getOrCreatePendingMset will save some work
|
// Note: If performance becomes an issue, making this getOrCreatePendingMset will save some work
|
||||||
|
Loading…
Reference in New Issue
Block a user