Skip to content

Commit

Permalink
Merge pull request #568 from ptschip/dev_minxthin
Browse files Browse the repository at this point in the history
bug fix for -min-xthin-nodes
  • Loading branch information
gandrewstone committed May 15, 2017
2 parents e06e4ef + c975960 commit 33bfd36
Show file tree
Hide file tree
Showing 2 changed files with 10 additions and 2 deletions.
8 changes: 8 additions & 0 deletions src/net.cpp
Expand Up @@ -1832,6 +1832,14 @@ void ThreadOpenConnections()
nDisconnects++;
}
}

// In the event that outbound nodes restart or drop off the network over time we need to
// replenish the number of disconnects allowed once per day.
if (GetTime() - nStart > 86400)
{
nDisconnects = 0;
nStart = GetTime();
}
}

// If disconnected then wait for disconnection completion
Expand Down
4 changes: 2 additions & 2 deletions src/net.h
Expand Up @@ -74,8 +74,8 @@ static const unsigned int DEFAULT_MAX_PEER_CONNECTIONS = 125;
static const unsigned int DEFAULT_MAX_OUTBOUND_CONNECTIONS = 8;
/** BU: The minimum number of xthin nodes to connect */
static const uint8_t MIN_XTHIN_NODES = 4;
/** BU: The maximum disconnects while searching for xthin nodes to connect */
static const unsigned int MAX_DISCONNECTS = 500;
/** BU: The daily maximum disconnects while searching for xthin nodes to connect */
static const unsigned int MAX_DISCONNECTS = 200;
/** The default for -maxuploadtarget. 0 = Unlimited */
static const uint64_t DEFAULT_MAX_UPLOAD_TARGET = 0;
/** Default for blocks only*/
Expand Down

0 comments on commit 33bfd36

Please sign in to comment.