-
Notifications
You must be signed in to change notification settings - Fork 38.7k
Use RelevantServices instead of node_network in AttemptToEvict. #9052
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
Conversation
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.
|
utACK d32036a |
|
good |
| // 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; |
There was a problem hiding this comment.
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.
There was a problem hiding this comment.
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.
There was a problem hiding this comment.
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.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Yes. :)
…oEvict. d32036a Use RelevantServices instead of node_network in AttemptToEvict. (Gregory Maxwell)
|
@gmaxwell Should this be backported to 0.13? |
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
…ttemptToEvict. d32036a Use RelevantServices instead of node_network in AttemptToEvict. (Gregory Maxwell)
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
…ttemptToEvict. d32036a Use RelevantServices instead of node_network in AttemptToEvict. (Gregory Maxwell)
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.