Skip to content

Commit bbe637a

Browse files
Liuhaaidustinxie
authored andcommitted
[actpool] fix bug in worker.Reset() (#4159)
* fix bug in worker.Reset()
1 parent 52ec91d commit bbe637a

File tree

1 file changed

+7
-1
lines changed

1 file changed

+7
-1
lines changed

actpool/queueworker.go

Lines changed: 7 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -238,8 +238,14 @@ func (worker *queueWorker) Reset(ctx context.Context) {
238238
worker.emptyAccounts.Set(from, struct{}{})
239239
return
240240
}
241+
var pendingNonce uint64
242+
if protocol.MustGetFeatureCtx(ctx).UseZeroNonceForFreshAccount {
243+
pendingNonce = confirmedState.PendingNonceConsideringFreshAccount()
244+
} else {
245+
pendingNonce = confirmedState.PendingNonce()
246+
}
241247
// Remove all actions that are committed to new block
242-
acts := queue.UpdateAccountState(confirmedState.PendingNonce(), confirmedState.Balance)
248+
acts := queue.UpdateAccountState(pendingNonce, confirmedState.Balance)
243249
acts2 := queue.UpdateQueue()
244250
worker.ap.removeInvalidActs(append(acts, acts2...))
245251
// Delete the queue entry if it becomes empty

0 commit comments

Comments
 (0)