Use of node_network here is really meant to be a proxy of "likely to send us blocks in the future". RelevantServices is the right criteria now.
Use RelevantServices instead of node_network in AttemptToEvict. #9052
pull gmaxwell wants to merge 1 commits into bitcoin:master from gmaxwell:prefer_relevant2 changing 1 files +4 −3-
gmaxwell commented at 12:43 AM on November 1, 2016: contributor
-
d32036a47d
Use RelevantServices instead of node_network in AttemptToEvict.
Use of node_network here is really meant to be a proxy of "likely to send us blocks in the future". RelevantServices is the right criteria now.
-
instagibbs commented at 3:05 PM on November 1, 2016: member
utACK d32036a47d9ccdc38628a7a75bb8b711af462e4f
-
hearbeat commented at 1:21 AM on November 2, 2016: none
good
- dcousens approved
- laanwj added the label P2P on Nov 2, 2016
-
in src/net.cpp:None in d32036a47d
849 | @@ -850,7 +850,7 @@ static bool CompareNodeBlockTime(const NodeEvictionCandidate &a, const NodeEvict 850 | { 851 | // There is a fall-through here because it is common for a node to have many peers which have not yet relayed a block. 852 | if (a.nLastBlockTime != b.nLastBlockTime) return a.nLastBlockTime < b.nLastBlockTime; 853 | - if (a.fNetworkNode != b.fNetworkNode) return b.fNetworkNode; 854 | + if (a.fRelevantServices != b.fRelevantServices) return b.fRelevantServices;
sipa commented at 7:13 AM on November 3, 2016:Shouldn't we return a.fRelevantServices here? The return value true indicates whether a is better than b.
gmaxwell commented at 9:10 AM on November 4, 2016:We want the best things to sort last, because the last entries from the sort are protected from eviction.
sipa commented at 9:16 AM on November 4, 2016:Oh, right. I'm sure I've gone through this code already and made the same mistake.
gmaxwell commented at 6:51 PM on November 5, 2016:Yes. :)
laanwj merged this on Nov 7, 2016laanwj closed this on Nov 7, 2016laanwj referenced this in commit c113a651f1 on Nov 7, 2016luke-jr referenced this in commit 3a3bcbf775 on Dec 2, 2016codablock referenced this in commit 84559c0569 on Jan 13, 2018lateminer referenced this in commit 8bbe525e02 on Oct 18, 2018andvgal referenced this in commit d47830301d on Jan 6, 2019MarcoFalke locked this on Sep 8, 2021
github-metadata-mirror
This is a metadata mirror of the GitHub repository bitcoin/bitcoin. This site is not affiliated with GitHub. Content is generated from a GitHub metadata backup.
generated: 2026-04-18 21:15 UTC
This is a metadata mirror of the GitHub repository bitcoin/bitcoin. This site is not affiliated with GitHub. Content is generated from a GitHub metadata backup.
generated: 2026-04-18 21:15 UTC
This site is hosted by @0xB10C
More mirrored repositories can be found on mirror.b10c.me
More mirrored repositories can be found on mirror.b10c.me