I connected a node A
to bitcoin testnet
(Port 18333). The node discovery happens and I see couple of connections between my node A
and the seed nodes. All of the sending and receiving happens between nodes ONLY via Port 18333 (I checked this in ThreadSocketHandler
)
I add another node B
(different laptop hence different IP) to the bitcoin testnet
. I initiate a addnode <lappyB_IP>:18333 onetry
connection from A
and it gets accepted. But now the port A
uses to send data is chosen randomly by OS and NOT 18333. This can be checked by
getpeerinfo
We should note that both are outbound connections from A
-- namely the first one is we connected to seednode and send one is we connected to another node B
. How come in the former data is getting sent via 18333 (default port) but in the later OS decides to chose a different port?
rpcnet.cpp
logic suppresses it ingetpeerinfo