les: generate random nums directly, not via strange conversions

This commit is contained in:
Péter Szilágyi
2021-05-21 12:36:04 +03:00
parent 81662fe827
commit 835fe06f1d
5 changed files with 10 additions and 16 deletions

View File

@ -18,6 +18,7 @@ package les
import (
"context"
"math/rand"
"sync"
"github.com/ethereum/go-ethereum/common"
@ -117,7 +118,7 @@ func (ltrx *lesTxRelay) send(txs types.Transactions, count int) {
ll := list
enc, _ := rlp.EncodeToBytes(ll)
reqID := genReqID()
reqID := rand.Uint64()
rq := &distReq{
getCost: func(dp distPeer) uint64 {
peer := dp.(*serverPeer)