From 36e5fe2b1920f39af8de2d6f0c719609b2dc2642 Mon Sep 17 00:00:00 2001 From: Felix Lange Date: Thu, 30 May 2024 16:17:43 +0200 Subject: [PATCH] p2p/netutil: fix bug in RandomAddr --- p2p/netutil/net.go | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/p2p/netutil/net.go b/p2p/netutil/net.go index 5a0d79fd10..37dd0424da 100644 --- a/p2p/netutil/net.go +++ b/p2p/netutil/net.go @@ -356,7 +356,7 @@ func IPToAddr(ip net.IP) netip.Addr { // RandomAddr creates a random IP address. func RandomAddr(rng *rand.Rand) netip.Addr { var bytes []byte - if rng.Intn(1) == 0 { + if rng.Intn(2) == 0 { bytes = make([]byte, 4) } else { bytes = make([]byte, 16)