mirror of
https://github.com/ethereum/go-ethereum.git
synced 2026-07-22 20:56:42 +00:00
core: fix too many goroutines in InitSignerInTransactions, close XFN-75 (#1662)
This commit is contained in:
parent
a3e78580ca
commit
bbaba9f6af
1 changed files with 4 additions and 1 deletions
|
|
@ -536,7 +536,10 @@ func ApplyEmptyTransaction(config *params.ChainConfig, statedb *state.StateDB, b
|
|||
}
|
||||
|
||||
func InitSignerInTransactions(config *params.ChainConfig, header *types.Header, txs types.Transactions) {
|
||||
nWorker := runtime.NumCPU()
|
||||
if txs.Len() == 0 {
|
||||
return
|
||||
}
|
||||
nWorker := min(runtime.NumCPU(), txs.Len())
|
||||
signer := types.MakeSigner(config, header.Number)
|
||||
chunkSize := txs.Len() / nWorker
|
||||
if txs.Len()%nWorker != 0 {
|
||||
|
|
|
|||
Loading…
Reference in a new issue