diff options
| author | Wladimir J. van der Laan <[email protected]> | 2016-11-07 13:13:29 +0100 |
|---|---|---|
| committer | Wladimir J. van der Laan <[email protected]> | 2016-11-07 13:14:04 +0100 |
| commit | c113a651f1f59805a66f0d11617a0c27eb984afe (patch) | |
| tree | 570221beb978b13f5a3a3155fd3868493a0402e2 /src/net.cpp | |
| parent | Merge #8568: new var DIST_CONTRIB adds useful things for packagers from contrib (diff) | |
| parent | Use RelevantServices instead of node_network in AttemptToEvict. (diff) | |
| download | discoin-c113a651f1f59805a66f0d11617a0c27eb984afe.tar.xz discoin-c113a651f1f59805a66f0d11617a0c27eb984afe.zip | |
Merge #9052: Use RelevantServices instead of node_network in AttemptToEvict.
d32036a Use RelevantServices instead of node_network in AttemptToEvict. (Gregory Maxwell)
Diffstat (limited to 'src/net.cpp')
| -rw-r--r-- | src/net.cpp | 7 |
1 files changed, 4 insertions, 3 deletions
diff --git a/src/net.cpp b/src/net.cpp index 15cf7ce8b..4ab8ef98a 100644 --- a/src/net.cpp +++ b/src/net.cpp @@ -809,7 +809,7 @@ struct NodeEvictionCandidate int64_t nMinPingUsecTime; int64_t nLastBlockTime; int64_t nLastTXTime; - bool fNetworkNode; + bool fRelevantServices; bool fRelayTxes; bool fBloomFilter; CAddress addr; @@ -834,7 +834,7 @@ static bool CompareNodeBlockTime(const NodeEvictionCandidate &a, const NodeEvict { // There is a fall-through here because it is common for a node to have many peers which have not yet relayed a block. if (a.nLastBlockTime != b.nLastBlockTime) return a.nLastBlockTime < b.nLastBlockTime; - if (a.fNetworkNode != b.fNetworkNode) return b.fNetworkNode; + if (a.fRelevantServices != b.fRelevantServices) return b.fRelevantServices; return a.nTimeConnected > b.nTimeConnected; } @@ -869,7 +869,8 @@ bool CConnman::AttemptToEvictConnection() if (node->fDisconnect) continue; NodeEvictionCandidate candidate = {node->id, node->nTimeConnected, node->nMinPingUsecTime, - node->nLastBlockTime, node->nLastTXTime, node->fNetworkNode, + node->nLastBlockTime, node->nLastTXTime, + (node->nServices & nRelevantServices) == nRelevantServices, node->fRelayTxes, node->pfilter != NULL, node->addr, node->nKeyedNetGroup}; vEvictionCandidates.push_back(candidate); } |