Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Use RelevantServices instead of node_network in AttemptToEvict. #9052

Merged
merged 1 commit into from Nov 7, 2016

Conversation

@gmaxwell
Copy link
Contributor

commented Nov 1, 2016

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 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

This comment has been minimized.

Copy link
Member

commented Nov 1, 2016

utACK d32036a

@hearbeat

This comment has been minimized.

Copy link

commented Nov 2, 2016

good

@laanwj laanwj added the P2P label Nov 2, 2016
@@ -850,7 +850,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;

This comment has been minimized.

Copy link
@sipa

sipa Nov 3, 2016

Member

Shouldn't we return a.fRelevantServices here? The return value true indicates whether a is better than b.

This comment has been minimized.

Copy link
@gmaxwell

gmaxwell Nov 4, 2016

Author Contributor

We want the best things to sort last, because the last entries from the sort are protected from eviction.

This comment has been minimized.

Copy link
@sipa

sipa Nov 4, 2016

Member

Oh, right. I'm sure I've gone through this code already and made the same mistake.

This comment has been minimized.

Copy link
@gmaxwell

gmaxwell Nov 5, 2016

Author Contributor

Yes. :)

@laanwj laanwj merged commit d32036a into bitcoin:master Nov 7, 2016
1 check passed
1 check passed
continuous-integration/travis-ci/pr The Travis CI build passed
Details
laanwj added a commit that referenced this pull request Nov 7, 2016
…oEvict.

d32036a Use RelevantServices instead of node_network in AttemptToEvict. (Gregory Maxwell)
@sdaftuar

This comment has been minimized.

Copy link
Member

commented Nov 19, 2016

@gmaxwell Should this be backported to 0.13?

luke-jr added a commit to luke-jr/bitcoin that referenced this pull request Dec 2, 2016
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.

Github-Pull: bitcoin#9052
Rebased-From: d32036a
codablock added a commit to codablock/dash that referenced this pull request Jan 13, 2018
…ttemptToEvict.

d32036a Use RelevantServices instead of node_network in AttemptToEvict. (Gregory Maxwell)
lateminer added a commit to lateminer/bitcoin that referenced this pull request Oct 18, 2018
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.

Github-Pull: bitcoin#9052
Rebased-From: d32036a
andvgal added a commit to energicryptocurrency/energi that referenced this pull request Jan 6, 2019
…ttemptToEvict.

d32036a Use RelevantServices instead of node_network in AttemptToEvict. (Gregory Maxwell)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
7 participants
You can’t perform that action at this time.