Merge 43704827b4 into merged_master (Bitcoin PR bitcoin/bitcoin#28211)

This commit is contained in:
Byron Hambly 2025-08-08 08:06:57 +02:00
commit 149eb7d34e
No known key found for this signature in database
GPG key ID: DE8F6EA20A661697
8 changed files with 16 additions and 18 deletions

View file

@ -299,10 +299,10 @@ def sha256sum_file(filename):
return h.digest()
# TODO: Remove and use random.randbytes(n) instead, available in Python 3.9
# TODO: Remove and use random.randbytes(n) directly
def random_bytes(n):
"""Return a random bytes object of length n."""
return bytes(random.getrandbits(8) for i in range(n))
return random.randbytes(n)
# RPC/P2P connection constants and functions