I'm playing around with connecting my node to another one of my nodes to see how many incoming connections I can handle. Whenever I add node A from node B with bitcoin-cli addnode 1.1.1.1 add after the first time, I get:

error code: -23 error message: Error: Node already added

Is there a way around this? Can I edit the source code somehow to allow multiple connections between the same nodes? Presumably I would only have to edit the code for the sending node, not the receiving node, since I think the receiving node has to be able to accept connections from what appear to be the same IP and port because of NATS? The alternative is to run many instances of bitcoind in pruned mode which would work I guess, but it's not ideal obviously

New contributor
user46871 is a new contributor to this site. Take care in asking for clarification, commenting, and answering. Check out our Code of Conduct.
  • I'm curious, why do you want to do this? – chytrik Dec 4 at 22:24
  • To see how many incoming connections my nodes can handle. :) – user46871 Dec 4 at 22:28
  • Max number of incoming connections is part of config. – James C. Dec 4 at 22:38
  • @JamesC. I know but I want to allow one node (A) to establish many outgoing connections to the same node (B) – user46871 Dec 4 at 22:40
  • Ok, it is not allowed as you already mentioned. The same p2p communication will be repeated, so multiple channels are redundant. If a node propagates a new tx or header, it will announce it to all channels. But if you still want to do it, I think the peer is id’ed by IP in version msg, so you would have to tweak the sourcecode to broadcast a different address for each channel, or accept identical IP on multiple inbound connections. – James C. Dec 4 at 22:48

Your Answer

user46871 is a new contributor. Be nice, and check out our Code of Conduct.

By clicking "Post Your Answer", you acknowledge that you have read our updated terms of service, privacy policy and cookie policy, and that your continued use of the website is subject to these policies.

Browse other questions tagged or ask your own question.