You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
Repository navigation
bitcoind shouldn't perform network activity if the option networkactive=0, e.g. [addrman] Selected IP:PORT from tried #34190
There are many logs like the examples below despite networkactive=0:
2025-12-31T12:24:47Z [addrman] Selected 34.75.109.94:8333 from tried
2025-12-31T12:24:47Z [tor] Error connecting to Tor control socket 2025-12-31T12:24:47Z [tor] Not connected to Tor control port 127.0.0.1:9051, retrying in 25.63 s
2025-12-31T12:28:43Z [net:error] Could not get best interface for default route: Element not found. (1168) 2025-12-31T12:28:43Z [net] portmap: Could not determine IPv4 default gateway
Expected behaviour
There isn't any network activity and so no such logs.
If you interpret "networkactive" to mean "this program will not perform any network-related activity" then "fixing" this would make sense. However of your interpretation is "toggle a connection to the bitcoin p2p network" then the current behaviour seems fine:
If you have networkactive and toggle it, then all bitcoin p2p connections are dropped
Toggle it again to re-enable connections
Configuring pmp, running the addrman loop and making a connection to the tor control port in readiness for future connections doesn't seem completely untoward, in my opinion.
Curious what others think here though, as giving torControlThread and mapport_thread knowledge of the state of networkactive is pretty easy. I didn't have a look at addrman yet though...
Configuring pmp, running the addrman loop and making a connection to the tor control port in readiness for future connections doesn't seem completely untoward, in my opinion.
I agree, but I don't think there is much advantage in doing those things when disconnected from the P2P network, no one will be surprised that Bitcoin Core isn't doing those things when networkactive is set to false. master...willcl-ark:bitcoin:refs/heads/respect-networkactive seems simple enough...
Curious what others think here though, as giving torControlThread and mapport_thread knowledge of the state of networkactive is pretty easy. I didn't have a look at addrman yet though...
I think these many selections from addrman is because we verify if the network is active at OpenNetworkConnection, so this addrman interation might come from ThreadOpenConnections.
Activity
willcl-ark commentedon Jan 13, 2026
If you interpret "networkactive" to mean "this program will not perform any network-related activity" then "fixing" this would make sense. However of your interpretation is "toggle a connection to the bitcoin p2p network" then the current behaviour seems fine:
Configuring pmp, running the addrman loop and making a connection to the tor control port in readiness for future connections doesn't seem completely untoward, in my opinion.
Curious what others think here though, as giving
torControlThreadandmapport_threadknowledge of the state ofnetworkactiveis pretty easy. I didn't have a look at addrman yet though...edit: I did end up taking a look at what an implementation for this would look like for mapport and torcontroller here: master...willcl-ark:bitcoin:refs/heads/respect-networkactive
Seems to work ok.
davidgumberg commentedon Jan 14, 2026
I agree, but I don't think there is much advantage in doing those things when disconnected from the P2P network, no one will be surprised that Bitcoin Core isn't doing those things when
networkactiveis set to false. master...willcl-ark:bitcoin:refs/heads/respect-networkactive seems simple enough...brunoerg commentedon Jan 15, 2026
I think these many selections from addrman is because we verify if the network is active at
OpenNetworkConnection, so this addrman interation might come fromThreadOpenConnections.net: don't perform network activity when networkactive=0