utreexo / utreexod

A fully validating Bitcoin node with Utreexo support
ISC License
90 stars 21 forks source link

addrmgr: fix intermittent addrmanager_internal_test bug #146

Closed kcalvinalvin closed 7 months ago

kcalvinalvin commented 7 months ago

Sometimes the tests in the addrmanager_internal_test will fail with: "addrmanager_internal_test.go:124: expected to find 5 addresses, found 4"

This is because the generated address with randAddr() may not always generate an address that's routable. If the address is not routable, that address will not be added to the manager when calling AddAddress().

This bug is fixed by creating a new function routableRandAddr() that always creates a routable random address.