core/txpool: remove deprecated uses of math.rand #26710 (#1843)

This commit is contained in:
Daniel Liu 2025-12-11 18:49:20 +08:00 committed by GitHub
parent d3e994377b
commit 6ccbf98292
No known key found for this signature in database
GPG key ID: B5690EEEBB952194

View file

@ -18,6 +18,7 @@ package txpool
import (
"crypto/ecdsa"
crand "crypto/rand"
"errors"
"fmt"
"math"
@ -112,7 +113,7 @@ func pricedTransaction(nonce uint64, gaslimit uint64, gasprice *big.Int, key *ec
func pricedDataTransaction(nonce uint64, gaslimit uint64, gasprice *big.Int, key *ecdsa.PrivateKey, bytes uint64) *types.Transaction {
data := make([]byte, bytes)
rand.Read(data)
crand.Read(data)
tx, _ := types.SignTx(types.NewTransaction(nonce, common.Address{}, big.NewInt(0), gaslimit, gasprice, data), types.HomesteadSigner{}, key)
return tx