Use RelevantServices instead of node_network in AttemptToEvict.#9052
Merged
laanwj merged 1 commit intobitcoin:masterfrom Nov 7, 2016
gmaxwell:prefer_relevant2
Merged
Use RelevantServices instead of node_network in AttemptToEvict.#9052laanwj merged 1 commit intobitcoin:masterfrom gmaxwell:prefer_relevant2
laanwj merged 1 commit intobitcoin:masterfrom
gmaxwell:prefer_relevant2
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.
Member
|
utACK d32036a |
|
good |
dcousens
approved these changes
Nov 2, 2016
sipa
reviewed
Nov 3, 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; |
Member
There was a problem hiding this comment.
Shouldn't we return a.fRelevantServices here? The return value true indicates whether a is better than b.
Contributor
Author
There was a problem hiding this comment.
We want the best things to sort last, because the last entries from the sort are protected from eviction.
Member
There was a problem hiding this comment.
Oh, right. I'm sure I've gone through this code already and made the same mistake.
laanwj
added a commit
that referenced
this pull request
Nov 7, 2016
…oEvict. d32036a Use RelevantServices instead of node_network in AttemptToEvict. (Gregory Maxwell)
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)
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to subscribe to this conversation on GitHub.
Already have an account?
Sign in.
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
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.