Skip to content

Conversation

@gmaxwell
Copy link
Contributor

@gmaxwell gmaxwell 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
Copy link
Member

utACK d32036a

@hearbeat
Copy link

hearbeat commented Nov 2, 2016

good

@laanwj laanwj added the P2P label Nov 2, 2016
// 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;
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

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

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

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

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

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

Copy link
Contributor Author

@gmaxwell gmaxwell Nov 5, 2016

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Yes. :)

@laanwj laanwj merged commit d32036a into bitcoin:master Nov 7, 2016
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
Copy link
Member

@gmaxwell Should this be backported to 0.13?

luke-jr pushed 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 pushed 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 pushed 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 pushed a commit to energicryptocurrency/gen2-energi that referenced this pull request Jan 6, 2019
…ttemptToEvict.

d32036a Use RelevantServices instead of node_network in AttemptToEvict. (Gregory Maxwell)
@bitcoin bitcoin locked as resolved and limited conversation to collaborators Sep 8, 2021
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.

Labels

Projects

None yet

Development

Successfully merging this pull request may close these issues.

7 participants