I've followed all these steps How can I setup Bitcoin to be anonymous with Tor?

I've added onlynet line in my conf file, but all my peers come with ipv4 connection. When I run getnetworkinfo I get ipv4, ipv6 and onion all as reachable. Only unreachable is i2p. How do I force my node to use tor and not ipv4 and ipv6.

UPDATE After deleting peers.dat file, ipv4 and ipv6 would become unreachable under getnetworkinfo. However after some time, not sure if caused by reboot or smth else, it would turn back to reachable and in peerinfo half of the peers would be through ipv4.

Conf file

  • Can you paste your exact bitcoin.conf file into your question? Dec 1, 2022 at 18:58
  • Hey Pieter, thanks for quick reply. I think I solved it tho. I've tried lots of things. Seems like deleting peers.dat file helped. Currently have 8 peers, all onion.media.tenor.com/d-51Xsn5N3AAAAAd/oignon-onion.gif Dec 1, 2022 at 19:07
  • onlynet=... only controls outbound connections. Are you just seeing inbound connections through IPv4 and IPv6? Dec 2, 2022 at 14:09
  • At the moment I have 9 onion connections, from which 8 are "outbound full relay" and 1 is "block relay only", and 1 ipv4 connection that is "block relay only". I'm not sure if that describes inbound and outbound connections. If not can you please point me to how to check that. Thanks Dec 2, 2022 at 14:17
  • Can you paste the output of getpeerinfo in your answer? Dec 2, 2022 at 14:21

1 Answer 1


There have been recently some improvements to make sure onlynet is respected, most importantly https://github.com/bitcoin/bitcoin/pull/22834 which has been part of bitcoin core since v23.1.

It has been reported before that older versions of Bitcoin Core would in some situations not respect -onlynet=onion, see e.g. the discussion in https://github.com/bitcoin/bitcoin/issues/22647.

Another issue, that sometimes during initial peer bootstrap (empty peers.dat) DNS seeds would be queried violating the -onlynet option, was fixed in https://github.com/bitcoin/bitcoin/pull/25678 (which will be contained in v 24.x).

  • So it would help to know which version of Bitcoin core you are using?
    – Lightlike
    Dec 2, 2022 at 18:36
  • So, after upgrading to 23, was using 22, all my connections are now onion. I've also noticed there is 14 connections now in comparison to 10 in previous versions and "cjdns" as new type. Gonna explore that more. Thanks to Pieter for explaining stuff and Lightlike for upgrade idea. I'm not sure how to close this request or if it needs closing. Seems I can't cast vote yet, however thanks for your time guys. Dec 3, 2022 at 14:52

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Not the answer you're looking for? Browse other questions tagged or ask your own question.