From b5b98c1d16085a44da89675af77c1efeda1e215d Mon Sep 17 00:00:00 2001 From: Liuhaai Date: Wed, 20 Dec 2023 12:09:23 -0800 Subject: [PATCH] skip adding accounts if pending acts is empty --- actpool/queueworker.go | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/actpool/queueworker.go b/actpool/queueworker.go index 9cc923179b..a2d51cedd5 100644 --- a/actpool/queueworker.go +++ b/actpool/queueworker.go @@ -248,9 +248,13 @@ func (worker *queueWorker) PendingActions(ctx context.Context) []*pendingActions // Remove the actions that are already timeout acts := queue.UpdateQueue() worker.ap.removeInvalidActs(acts) + pd := queue.PendingActs(ctx) + if len(pd) == 0 { + continue + } actionArr = append(actionArr, &pendingActions{ sender: from, - acts: queue.PendingActs(ctx), + acts: pd, }) } return actionArr