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,8 +18,6 @@ package les
import (
"context"
"crypto/rand"
"encoding/binary"
"fmt"
"sync"
"time"
@ -430,10 +428,3 @@ func (r *sentReq) stop(err error) {
func (r *sentReq) getError() error {
return r.err
}
// genReqID generates a new random request ID
func genReqID() uint64 {
var rnd [8]byte
rand.Read(rnd[:])
return binary.BigEndian.Uint64(rnd[:])
}