A lot of people have been asking about connections, so here is a quick explanation.
Disclaimer: The following applies to the “standard” c++ QT wallet.
TL:DR: More than 3 is good. You can not have more than 16 outgoing connections, but you may get more if other nodes connect to you.
What is a connection?A connection is simply two wallets talking to each-other. Connections are classified as either outgoing or incoming, based on who it was initiated by. An outgoing is established when your wallet reaches out asks to connect to somebody else’s wallet (peer). An incoming connection occurs when a peer connects to you.
How does the wallet find connections?When a wallet first starts it has zero connections, and , it needs some IP addresses to reach out to in order to new peers. There are several ways a wallet will try and get its first connection
- Query DNS seeds for a list of peers
- Use static IP peers coded into the wallet.
- Load a list of known peers from peers.dat
- Load list of peers from walletname.conf file
Once a wallet gets its first connection, it will then ask the peer for a list of other peers it can try and connect to.
How many do you need?In order for the wallet to work correctly, it needs to have a MINIMUM of one connection. A wallet can work perfectly fine, using only one high quality connection to the network. It is desired that a wallet have more than one connection for redundancy and network health. A total of three to five connections is more than enough for the wallet to work correctly.
But aren't more connections better?Well, it CAN be, in terms of the health of the entire network, however after 3–5 connections there really is little improvement in wallet function. Each connection requires resources to maintain, and the more connections you have the harder your computer will need to work in order to communicate with all the other peers. Once your wallet has a stable connection to the network, more connections will not increase the speed or improve staking for PoS coins.
I have 16, BUT I WANT MORRRR!Well, then, be patient. Each connection requires additional CPU power to send, receive, and process the transmitted messages. Most wallets have a hard coded limit of 16 outgoing connections, so that your wallet does not create more work for the network than necessary. To help new wallets gain connections even if your already have 16, the incoming connection default limit is set at 125. This means your wallet can not ask for more than 16 connections, but it can accept more connections from other nodes with low connection counts. Because of these limits, only way to get more than 16 connections is to have your wallet open for a long period of time and allow other new nodes to connect to you.
A Note about AV, Firewalls, Routers, Seeds, and Bears, Oh MY!Sometimes there are things in the way blocking your wallet from getting more connections. If a wallet is getting ZERO connections, be suspicious for some form of port forwarding or blocking issues with a router or firewall. If you are stuck at 16 connections and never get any more, perhaps your network is not configured to allow for incoming connections.
~JJ12880