Bitcoin Forum

Bitcoin => Bitcoin Technical Support => Topic started by: callmejoe on February 09, 2024, 01:54:41 PM



Title: [Solved] Bitcoin-Qt maxconnections ignored
Post by: callmejoe on February 09, 2024, 01:54:41 PM
I have maxconnections=20 set in the bitcoin-qt.conf file but it seems to ignore the setting.  right now network connections at 48 inbound and 10 outbound.

When i run it as bitcoind, instead of using bitcoin-qt, the maxconnections works fine, but that is in a different config file.





Title: Re: Bitcoin-Qt maxconnections ignored
Post by: BitMaxz on February 09, 2024, 04:16:32 PM
Did you try to shut down the Bitcoin and restart it? try it first and test it again.

Would you mind telling us what exactly do you plan for why you want to change maxconnections to 20?
According to them, it's not a healthy network if you change this.

Check this guide here https://github.com/bitcoin/bitcoin/blob/master/doc/reduce-traffic.md


Title: Re: Bitcoin-Qt maxconnections ignored
Post by: callmejoe on February 09, 2024, 07:15:38 PM
yes i've shutdown and restarted  but it is still ignoring the max setting.

and i just dont want over a 100 people accessing my network.


Title: Re: Bitcoin-Qt maxconnections ignored
Post by: BitMaxz on February 09, 2024, 08:37:32 PM
yes i've shutdown and restarted  but it is still ignoring the max setting.

and i just dont want over a 100 people accessing my network.

I don't know how this thing works but if you don't want more people to connect to your node then try to play the value of maxconnection I suggest 12 or lower and let's see for the changes on the inbound peers.

Also, play with the maxuploadtarget= according to the link I posted above.

Or try this tool https://jlopp.github.io/bitcoin-core-config-generator/ you can copy their predefined config and paste it into your bitcoin.conf file you can choose between low bandwidth or privacy under a predefined config let see any changes in your inbound and outbound peers.


Title: Re: Bitcoin-Qt maxconnections ignored
Post by: BlackHatCoiner on February 09, 2024, 09:24:32 PM
I have maxconnections=20 set in the bitcoin-qt.conf file but it seems to ignore the setting.
Have you tried disabling incoming connections temporarily and see how many connections you'll have? The default option is to accept 11 outgoing max.

When i run it as bitcoind, instead of using bitcoin-qt, the maxconnections works fine, but that is in a different config file.
What do you mean? How can you have more than one configuration file? Both Bitcoin-QT and bitcoind, if run with no datadir and conf parameters, read from the default data directory (https://en.bitcoin.it/wiki/Data_directory), where there's bitcoin.conf.


Title: Re: Bitcoin-Qt maxconnections ignored
Post by: achow101 on February 09, 2024, 09:37:53 PM
What bitcoin-qt.conf? Bitcoin Core does not have such a file for people to write configuration options to.


Title: Re: Bitcoin-Qt maxconnections ignored
Post by: callmejoe on February 10, 2024, 01:24:16 AM
I've been running Bitcoin Core using bitcoind -daemon for the last few years. I have it running on my RaspberryPi and yes it uses the config file at ~/.bitcoin. I have the maxconnections set here to 30.  Bitcoind always adhered to the maxconnections setting.

Just this week I decided to use bitcoin-qt (for the first time in a while) to teach someone about Bitcoin.  So I shutdown bitcoind and started bitcoin-qt.  Bitcoin-Qt always created a config file at ~/.config/Bitcoin/Bitcoin-Qt.conf.  When I noticed the number of connections going higher than I set it, I thought I needed to add a maxconnections setting to that bitcoin-qt.conf file.

But I am realizing now that the bitcoin-qt.conf isn't the place to manually add settings.   I guess it contains changes settings strictly made in the GUI.  I decided to delete the current bitcoin-qt.conf file and restarted bitcoin-qt. It regenerated that bitcoin-qt.conf file and then somehow magically now it is adhering to the original maxconnections setting.  Maybe the file was corrupt or something(?)

Anyway thanks for feedback, it helped me get back on track.







Title: Re: Bitcoin-Qt maxconnections ignored
Post by: nc50lc on February 10, 2024, 08:07:34 AM
Quote from: callmejoe
Maybe the file was corrupt or something(?)
The possible scenario is you've set the custom data directory using the GUI's welcome screen that was saved in that qt config file.
In that case, Bitcoin-qt had been using the "bitcoin.conf" saved in that custom data directory instead of the one at ~/.bitcoin.
The reason why it's not adhering to the maxconnections setting that you've been using in bitcoind.

I decided to delete the current bitcoin-qt.conf file and restarted bitcoin-qt. It regenerated that bitcoin-qt.conf file and then somehow magically now it is adhering to the original maxconnections setting.
Continuing from the above, after deleting the file, you've essentially deleted the custom datadir set by the GUI and made Bitcoin-qt use the "bitcoin.conf" at ~/.bitcoin.
That worked seamlessly because you must have set the same custom directory in that bitcoin.conf file.


Title: Re: [Solved] Bitcoin-Qt maxconnections ignored
Post by: ABCbits on February 11, 2024, 12:31:27 PM
If you still use term Bitcoin-Qt (these days it's called Bitcoin Core), i'm also worried that you use very outdated software which have slower performance[1] with possible bug/security issue.

[1] https://blog.lopp.net/bitcoin-core-performance-evolution/ (https://blog.lopp.net/bitcoin-core-performance-evolution/)


Title: Re: [Solved] Bitcoin-Qt maxconnections ignored
Post by: nc50lc on February 11, 2024, 01:17:56 PM
If you still use term Bitcoin-Qt (these days it's called Bitcoin Core), -snip-
When a user mentioned "Bitcoin-qt" he's talking about the GUI, not the software name per se.
If you have Bitcoin Core installed, you're actually using the executables 'bitcoin-qt' to launch Bitcoin Core with GUI or 'bitcoind' to run in the command line.