From 6add84724a10f3a77641c5845ab0b7b4a2d0bdd0 Mon Sep 17 00:00:00 2001 From: Monkey Date: Fri, 23 May 2025 23:17:46 +0800 Subject: [PATCH] extract from only if needed --- miner/worker.go | 7 +++---- 1 file changed, 3 insertions(+), 4 deletions(-) diff --git a/miner/worker.go b/miner/worker.go index d80cb8913b..f6101a6da7 100644 --- a/miner/worker.go +++ b/miner/worker.go @@ -390,10 +390,6 @@ func (miner *Miner) commitTransactions(env *environment, plainTxs, blobTxs *tran continue } - // Error may be ignored here. The error has already been checked - // during transaction acceptance in the transaction pool. - from, _ := types.Sender(env.signer, tx) - // Check whether the tx is replay protected. If we're not in the EIP155 hf // phase, start ignoring the sender until we do. if tx.Protected() && !miner.chainConfig.IsEIP155(env.header.Number) { @@ -407,6 +403,9 @@ func (miner *Miner) commitTransactions(env *environment, plainTxs, blobTxs *tran err := miner.commitTransaction(env, tx) switch { case errors.Is(err, core.ErrNonceTooLow): + // Error may be ignored here. The error has already been checked + // during transaction acceptance in the transaction pool. + from, _ := types.Sender(env.signer, tx) // New head notification data race between the transaction pool and miner, shift log.Trace("Skipping transaction with low nonce", "hash", ltx.Hash, "sender", from, "nonce", tx.Nonce()) txs.Shift()