Bitcoin Forum
May 07, 2024, 07:48:32 PM *
News: Latest Bitcoin Core release: 27.0 [Torrent]
 
   Home   Help Search Login Register More  
Pages: [1]
  Print  
Author Topic: maxconnections for internet vs. maxconnections for local network  (Read 178 times)
btc123thatthere (OP)
Member
**
Offline Offline

Activity: 131
Merit: 29


View Profile
December 09, 2020, 10:50:24 PM
 #1

Hi there

I had maxconnections set to 4 (maxconnections=4) on my bitcoin server node, and noticed that my other machine on the local network running bitcoin core wasn't able to connect to to it.
So, I changed maxconnections to 40 (maxconnections=40), restarted the server node, and the other machine connected to it without a problem.

My question is: is their a way to limit maxconnections for internet connections vs limiting maxconnections for local network connections?

Thanks
1715111312
Hero Member
*
Offline Offline

Posts: 1715111312

View Profile Personal Message (Offline)

Ignore
1715111312
Reply with quote  #2

1715111312
Report to moderator
Once a transaction has 6 confirmations, it is extremely unlikely that an attacker without at least 50% of the network's computation power would be able to reverse it.
Advertised sites are not endorsed by the Bitcoin Forum. They may be unsafe, untrustworthy, or illegal in your jurisdiction.
1715111312
Hero Member
*
Offline Offline

Posts: 1715111312

View Profile Personal Message (Offline)

Ignore
1715111312
Reply with quote  #2

1715111312
Report to moderator
1715111312
Hero Member
*
Offline Offline

Posts: 1715111312

View Profile Personal Message (Offline)

Ignore
1715111312
Reply with quote  #2

1715111312
Report to moderator
NotATether
Legendary
*
Offline Offline

Activity: 1596
Merit: 6730


bitcoincleanup.com / bitmixlist.org


View Profile WWW
December 09, 2020, 11:22:51 PM
Merited by hosseinimr93 (1)
 #2

No there isn't, the maxconnections parameter limits inbound connections from clients on all networks. It doesn't treat any network interfaces specially.

The reason why your node failed to connect to your other node when you had maxconnections=4 is because Bitcoin Core has a predefined list of peers that it connects to first when you start Core. It scrapes their lists of peers, and lists of peers of those peers, and so on, and tries to connect to each node until it saturates the number of connections. So it finished 4 connections quickly before you were able to connect with your other node.

Core usually gets around 15 inbound connections very quickly after it's started, from my experience. So setting maxconnections=40 gave you more time for your other node to make a connection, but if you waited for too long, then there would also be no more slots for peers.

.
.BLACKJACK ♠ FUN.
█████████
██████████████
████████████
█████████████████
████████████████▄▄
░█████████████▀░▀▀
██████████████████
░██████████████
████████████████
░██████████████
████████████
███████████████░██
██████████
CRYPTO CASINO &
SPORTS BETTING
▄▄███████▄▄
▄███████████████▄
███████████████████
█████████████████████
███████████████████████
█████████████████████████
█████████████████████████
█████████████████████████
███████████████████████
█████████████████████
███████████████████
▀███████████████▀
█████████
.
odolvlobo
Legendary
*
Offline Offline

Activity: 4298
Merit: 3214



View Profile
December 10, 2020, 02:15:48 AM
 #3

Perhaps adding "connect=..." to the configuration files would ensure that at least one connects to the other.

Join an anti-signature campaign: Click ignore on the members of signature campaigns.
PGP Fingerprint: 6B6BC26599EC24EF7E29A405EAF050539D0B2925 Signing address: 13GAVJo8YaAuenj6keiEykwxWUZ7jMoSLt
nc50lc
Legendary
*
Offline Offline

Activity: 2408
Merit: 5591


Self-proclaimed Genius


View Profile
December 10, 2020, 03:22:38 AM
 #4

Another option aside from the above which will isolate your connection to the specified peers, you can also use "addnode=".
Then limit the maxconnections to your liking.

https://github.com/bitcoin/bitcoin/blob/master/share/examples/bitcoin.conf#L26-L34
Quote
Quick Primer on addnode vs connect
Let's say for instance you use addnode=4.2.2.4 addnode will connect you to and tell you about the nodes connected to 4.2.2.4.  In addition it will tell the other nodes connected to it that you exist so they can connect to you. connect will not do the above when you 'connect' to it. It will *only* connect you to 4.2.2.4 and no one else.

.
.HUGE.
▄██████████▄▄
▄█████████████████▄
▄█████████████████████▄
▄███████████████████████▄
▄█████████████████████████▄
███████▌██▌▐██▐██▐████▄███
████▐██▐████▌██▌██▌██▌██
█████▀███▀███▀▐██▐██▐█████

▀█████████████████████████▀

▀███████████████████████▀

▀█████████████████████▀

▀█████████████████▀

▀██████████▀▀
█▀▀▀▀











█▄▄▄▄
▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀
.
CASINSPORTSBOOK
▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄
▀▀▀▀█











▄▄▄▄█
btc123thatthere (OP)
Member
**
Offline Offline

Activity: 131
Merit: 29


View Profile
December 10, 2020, 08:32:57 AM
 #5

I've already got connect= on the client's .conf file (otherwise it probably wouldn't connect to it anyway.)

If I put connect= on the server's .conf file, will it serve the IP address specified in connect=, or is connect= only used for specifying blockchain sources?
nc50lc
Legendary
*
Offline Offline

Activity: 2408
Merit: 5591


Self-proclaimed Genius


View Profile
December 10, 2020, 08:57:24 AM
Merited by ABCbits (1), btc123thatthere (1)
 #6

If I put connect= on the server's .conf file, will it serve the IP address specified in connect=, or is connect= only used for specifying blockchain sources?
It will only connect to the peers you've specified in "connect" (one line per peer), it won't connect to others.
If you need to connect to rest of the network, I'd suggest you to use addnode= on the server machine instead.

For more info
: You can ready lines 49 and 53 in my previous post's link above, that's from bitcoin's repository.

.
.HUGE.
▄██████████▄▄
▄█████████████████▄
▄█████████████████████▄
▄███████████████████████▄
▄█████████████████████████▄
███████▌██▌▐██▐██▐████▄███
████▐██▐████▌██▌██▌██▌██
█████▀███▀███▀▐██▐██▐█████

▀█████████████████████████▀

▀███████████████████████▀

▀█████████████████████▀

▀█████████████████▀

▀██████████▀▀
█▀▀▀▀











█▄▄▄▄
▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀
.
CASINSPORTSBOOK
▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄
▀▀▀▀█











▄▄▄▄█
pooya87
Legendary
*
Offline Offline

Activity: 3444
Merit: 10555



View Profile
December 10, 2020, 09:27:04 AM
 #7

How can this be possible?
Does this mean just the list of nodes that 4.2.2.4 sends back in response to getaddr? But these aren't nodes that are connected to 4.2.2.4, these are nodes that 4.2.2.4 knows about and were either connected to at some point or received their information in an addr message.
What else am I missing?

.
.BLACKJACK ♠ FUN.
█████████
██████████████
████████████
█████████████████
████████████████▄▄
░█████████████▀░▀▀
██████████████████
░██████████████
████████████████
░██████████████
████████████
███████████████░██
██████████
CRYPTO CASINO &
SPORTS BETTING
▄▄███████▄▄
▄███████████████▄
███████████████████
█████████████████████
███████████████████████
█████████████████████████
█████████████████████████
█████████████████████████
███████████████████████
█████████████████████
███████████████████
▀███████████████▀
█████████
.
nc50lc
Legendary
*
Offline Offline

Activity: 2408
Merit: 5591


Self-proclaimed Genius


View Profile
December 10, 2020, 11:31:54 AM
 #8

https://github.com/bitcoin/bitcoin/blob/master/share/examples/bitcoin.conf#L26-L34
Quote
and tell you about the nodes connected to 4.2.2.4.
How can this be possible?
Does this mean just the list of nodes that 4.2.2.4 sends back in response to getaddr? But these aren't nodes that are connected to 4.2.2.4, these are nodes that 4.2.2.4 knows about and were either connected to at some point or received their information in an addr message.
AFAIK, a node's response to getaddr will only contain active peers and won't include the inactive ones. [CMIIAW]

.
.HUGE.
▄██████████▄▄
▄█████████████████▄
▄█████████████████████▄
▄███████████████████████▄
▄█████████████████████████▄
███████▌██▌▐██▐██▐████▄███
████▐██▐████▌██▌██▌██▌██
█████▀███▀███▀▐██▐██▐█████

▀█████████████████████████▀

▀███████████████████████▀

▀█████████████████████▀

▀█████████████████▀

▀██████████▀▀
█▀▀▀▀











█▄▄▄▄
▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀
.
CASINSPORTSBOOK
▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄
▀▀▀▀█











▄▄▄▄█
NotATether
Legendary
*
Offline Offline

Activity: 1596
Merit: 6730


bitcoincleanup.com / bitmixlist.org


View Profile WWW
December 10, 2020, 11:46:38 AM
Merited by pooya87 (1), nc50lc (1)
 #9

https://github.com/bitcoin/bitcoin/blob/master/share/examples/bitcoin.conf#L26-L34
Quote
and tell you about the nodes connected to 4.2.2.4.
How can this be possible?
Does this mean just the list of nodes that 4.2.2.4 sends back in response to getaddr? But these aren't nodes that are connected to 4.2.2.4, these are nodes that 4.2.2.4 knows about and were either connected to at some point or received their information in an addr message.
AFAIK, a peer's response to getaddr will only contain active peers and won't include the inactive nodes if it's currently not connected to them. [CMIIAW]

No actually Core stores a list of known peers and it sends peers from that list as a response to getaddr.

This is where in the RPC call the address are gathered: https://github.com/bitcoin/bitcoin/blob/e20b488395c1c6c54b934714b436f72a3d4ecb1c/src/rpc/net.cpp#L831

NodeContext has a CConnman member that has a getAddresses() method which is what's called here. That calls the getAddr method in CAddrMan, the class responsible for tracking all the known nodes. https://github.com/bitcoin/bitcoin/blob/884bde510e2db59ee44604e2cccabb0bf1ef6ada/src/addrman.h

This agrees with what's written in the developer docs:

Once a program has connected to the network, its peers can begin to send it addr (address) messages with the IP addresses and port numbers of other peers on the network, providing a fully decentralized method of peer discovery. Bitcoin Core keeps a record of known peers in a persistent on-disk database which usually allows it to connect directly to those peers on subsequent startups without having to use DNS seeds.

.
.BLACKJACK ♠ FUN.
█████████
██████████████
████████████
█████████████████
████████████████▄▄
░█████████████▀░▀▀
██████████████████
░██████████████
████████████████
░██████████████
████████████
███████████████░██
██████████
CRYPTO CASINO &
SPORTS BETTING
▄▄███████▄▄
▄███████████████▄
███████████████████
█████████████████████
███████████████████████
█████████████████████████
█████████████████████████
█████████████████████████
███████████████████████
█████████████████████
███████████████████
▀███████████████▀
█████████
.
nc50lc
Legendary
*
Offline Offline

Activity: 2408
Merit: 5591


Self-proclaimed Genius


View Profile
December 10, 2020, 12:24:41 PM
 #10

-snip-
Thanks for the correction.
I'm aware of the persistent peer database, what had been unclear to me was what's being sent in response to getaddr.

.
.HUGE.
▄██████████▄▄
▄█████████████████▄
▄█████████████████████▄
▄███████████████████████▄
▄█████████████████████████▄
███████▌██▌▐██▐██▐████▄███
████▐██▐████▌██▌██▌██▌██
█████▀███▀███▀▐██▐██▐█████

▀█████████████████████████▀

▀███████████████████████▀

▀█████████████████████▀

▀█████████████████▀

▀██████████▀▀
█▀▀▀▀











█▄▄▄▄
▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀
.
CASINSPORTSBOOK
▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄
▀▀▀▀█











▄▄▄▄█
pooya87
Legendary
*
Offline Offline

Activity: 3444
Merit: 10555



View Profile
December 10, 2020, 12:48:21 PM
 #11

Unless there is something I am missing about the communication protocol, that must just be ambiguity in the explanation of what is being received.

.
.BLACKJACK ♠ FUN.
█████████
██████████████
████████████
█████████████████
████████████████▄▄
░█████████████▀░▀▀
██████████████████
░██████████████
████████████████
░██████████████
████████████
███████████████░██
██████████
CRYPTO CASINO &
SPORTS BETTING
▄▄███████▄▄
▄███████████████▄
███████████████████
█████████████████████
███████████████████████
█████████████████████████
█████████████████████████
█████████████████████████
███████████████████████
█████████████████████
███████████████████
▀███████████████▀
█████████
.
Pages: [1]
  Print  
 
Jump to:  

Powered by MySQL Powered by PHP Powered by SMF 1.1.19 | SMF © 2006-2009, Simple Machines Valid XHTML 1.0! Valid CSS!