HWI icon indicating copy to clipboard operation
HWI copied to clipboard

`get_free_port` broken

Open brunoerg opened this issue 5 months ago • 0 comments

When running the test_coldcard, I noticed that every run I was getting the following errors:

Error: Unable to bind to 127.0.0.1:53174 on this computer. Bitcoin Core is probably already running.
Error: Failed to listen on any port. Use -listen=0 if you want this.

Probably related to the get_free_port function since setting up the p2p_port and rpc_port manually worked:

def get_free_port():
        s = socket.socket(socket.AF_INET, socket.SOCK_STREAM)
        s.bind(("", 0))
        s.listen(1)
        port = s.getsockname()[1]
        s.close()
        return por

brunoerg avatar Jul 29 '25 17:07 brunoerg