Add retries to mpool push message from lotus miner

This commit is contained in:
Shrenuj Bansal
2022-08-17 14:22:31 -04:00
parent cd5dd2727c
commit a59f977db1
3 changed files with 28 additions and 2 deletions
+2 -1
View File
@@ -56,6 +56,7 @@ import (
"github.com/filecoin-project/lotus/chain/gen/slashfilter"
"github.com/filecoin-project/lotus/chain/types"
"github.com/filecoin-project/lotus/journal"
"github.com/filecoin-project/lotus/lib/retry"
"github.com/filecoin-project/lotus/markets"
"github.com/filecoin-project/lotus/markets/dagstore"
"github.com/filecoin-project/lotus/markets/idxprov"
@@ -89,7 +90,7 @@ func (a *UuidWrapper) MpoolPushMessage(ctx context.Context, msg *types.Message,
spec = new(api.MessageSendSpec)
}
spec.MsgUuid = uuid.New()
return a.FullNode.MpoolPushMessage(ctx, msg, spec)
return retry.Retry(5, 1, func() (*types.SignedMessage, error) { return a.FullNode.MpoolPushMessage(ctx, msg, spec) })
}
func MakeUuidWrapper(a v1api.RawFullNodeAPI) v1api.FullNode {