As long as the ordinary bind succeeds, a failure to bind on the onion listen address (127.0.0.1:8334
by default) is ignored and later the supposed listening address is used in ADD_ONION
to tell the Tor control daemon where to send incoming connections. This could result in a messy situation where two Bitcoin Cores run on the same machine and one of them is receiving the incoming Tor connections destined for the other, in addition to own ones. For example:
0# Will bind also to 127.0.0.1:8334.
1bitcoind -datadir=datadir1 -rpcbind=127.0.0.1:2001 -rpcallowip=127.0.0.1 -bind=1.2.3.4:2000
2
3# Will try to bind to 127.0.0.1:8334, will fail but nevertheless will instruct
4# the Tor daemon to send incoming connections to 127.0.0.1:8334 where the other
5# bitcoind is listening.
6bitcoind -datadir=datadir2 -rpcbind=127.0.0.1:3001 -rpcallowip=127.0.0.1 -bind=[5:6::7]:3000
Expected behavior
Currently it is required that the ordinary bind succeeds (-bind=...
) and that the RPC bind succeeds (-rpcbind=...
). -bind=...=onion
should be treated in the same way.