Welcome to the Dash Forum!

Please sign up to discuss the most innovative cryptocurrency!

Dash QT max connection

Discussion in 'Daemon and QT Wallet Support' started by Marian, Mar 30, 2017.

  1. Marian

    Marian New Member

    Joined:
    Mar 21, 2017
    Messages:
    12
    Likes Received:
    1
    Trophy Points:
    3
    Hello

    In my dash.conf file I have an option maxconnections=250. Unfortunately it seems to not work correctly form me. The program correctly reads the configuration file because in debug.log file i can find:

    2017-03-30 10:07:48 Using at most 250 connections (2048 file descriptors available)

    After a minute-two I have 8 connected peers, once every few minutes I get additional 8 peers, but they get disconnected in next minute and I still have only 8 nodes (the ones that I had after start). I think that this is a part of logs that present the disconection:
    2017-03-30 09:50:28 AdvertiseLocal: advertising address [2001:0:9d38:6abd:880:70a:ace6:6d1f]:9999
    2017-03-30 09:51:23 Closing Masternode connection: peer=18, addr=37.59.212.206:9999
    2017-03-30 09:51:23 Closing Masternode connection: peer=19, addr=45.32.178.75:9999
    2017-03-30 09:51:23 Closing Masternode connection: peer=20, addr=51.15.42.143:9999
    2017-03-30 09:51:23 Closing Masternode connection: peer=21, addr=104.207.145.8:9999
    2017-03-30 09:51:23 Closing Masternode connection: peer=22, addr=128.199.74.118:9999
    2017-03-30 09:51:23 Closing Masternode connection: peer=23, addr=176.31.145.58:9999
    2017-03-30 09:51:23 Closing Masternode connection: peer=24, addr=178.62.90.170:9999
    2017-03-30 09:51:23 Closing Masternode connection: peer=25, addr=194.135.80.180:9999
    2017-03-30 09:51:23 Closing Masternode connection: peer=26, addr=198.211.123.183:9999
    2017-03-30 09:51:23 CMasternodeMan::CheckAndRemove
    2017-03-30 09:51:23 ThreadSocketHandler -- removing node: peer=18 addr=37.59.212.206:9999 nRefCount=2 fNetworkNode=1 fInbound=0 fMasternode=1
    2017-03-30 09:51:23 ThreadSocketHandler -- removing node: peer=19 addr=45.32.178.75:9999 nRefCount=2 fNetworkNode=1 fInbound=0 fMasternode=1
    2017-03-30 09:51:23 ThreadSocketHandler -- removing node: peer=20 addr=51.15.42.143:9999 nRefCount=2 fNetworkNode=1 fInbound=0 fMasternode=1
    2017-03-30 09:51:23 ThreadSocketHandler -- removing node: peer=21 addr=104.207.145.8:9999 nRefCount=2 fNetworkNode=1 fInbound=0 fMasternode=1
    2017-03-30 09:51:23 ThreadSocketHandler -- removing node: peer=22 addr=128.199.74.118:9999 nRefCount=2 fNetworkNode=1 fInbound=0 fMasternode=1
    2017-03-30 09:51:23 ThreadSocketHandler -- removing node: peer=23 addr=176.31.145.58:9999 nRefCount=2 fNetworkNode=1 fInbound=0 fMasternode=1
    2017-03-30 09:51:23 ThreadSocketHandler -- removing node: peer=24 addr=178.62.90.170:9999 nRefCount=2 fNetworkNode=1 fInbound=0 fMasternode=1
    2017-03-30 09:51:23 ThreadSocketHandler -- removing node: peer=25 addr=194.135.80.180:9999 nRefCount=2 fNetworkNode=1 fInbound=0 fMasternode=1
    2017-03-30 09:51:23 ThreadSocketHandler -- removing node: peer=26 addr=198.211.123.183:9999 nRefCount=2 fNetworkNode=1 fInbound=0 fMasternode=1


    So it looks like the additional (on top of 8) nodes are master nodes that decide to disconnect after a minute...

    Any suggestions?
     
  2. UdjinM6

    UdjinM6 Official Dash Dev
    Dash Core Team Moderator

    Joined:
    May 20, 2014
    Messages:
    3,637
    Likes Received:
    3,536
    Trophy Points:
    1,183
    Code:
    -maxconnections=<n>          Maintain at most <n> connections to peers (temporary service connections excluded)
    
    It will only create 8 "normal" outbound connection regardless, maxconnections limits the number of total "normal" connections allowing you to accept (maxconnections - 8) inbound connections. These 8 additional connections you see are "temporary service connections" which are not counted.
     
  3. Marian

    Marian New Member

    Joined:
    Mar 21, 2017
    Messages:
    12
    Likes Received:
    1
    Trophy Points:
    3
    I don't get it. Maybe simpler question, how can I be connected in 'normal' way with more than 8 peers? Since setting maxconnection seams not to work
     
  4. UdjinM6

    UdjinM6 Official Dash Dev
    Dash Core Team Moderator

    Joined:
    May 20, 2014
    Messages:
    3,637
    Likes Received:
    3,536
    Trophy Points:
    1,183
    maxconnection works, just not in the way you expect it to work :) maxconnections limits total number of connections (inbound + outbound). However max number of outbound connections is hard-coded. To have more than 8 "normal" outbound connections you need to tweak "const int MAX_OUTBOUND_CONNECTIONS = 8;" in net.cpp and compile from source. To have more inbound connections, you need someone to actually connect to you but don't expect this to happen too often because there are plenty of stable 24/7 full nodes (aka masternodes) and most nodes will prefer them when they choose peers to connect to and not some rarely seen node (qt wallet).
     
    • Useful Useful x 2
    • Like Like x 1