nethermind
nethermind copied to clipboard
Fix peer dropped randomly
In DropUselessPeers, peer with lowest head number is dropped. With FCU peer refreshing, all peer that is not dropped, have the same head number. This causes the peer that get dropped to be random as the backing store is a concurrent dictionary.
Changes:
- Use latency as last comparison.
Types of changes
What types of changes does your code introduce?
Put an x in the boxes that apply
- [X] Bugfix (non-breaking change which fixes an issue)
- [ ] New feature (non-breaking change which adds functionality)
- [ ] Breaking change (fix or feature that would cause existing functionality to not work as expected)
- [ ] Documentation Update
- [ ] Code style update (formatting, renaming)
- [ ] Refactoring (no functional changes, no api changes)
- [ ] Build related changes
- [ ] Other (please describe):
Testing
Requires testing
- [X] Yes
- [ ] No
In case you checked yes, did you write tests??
- [ ] Yes
- [X] No
Running smoke
Further comments (optional)
If this is a relatively large or complex change, kick off the discussion by explaining why you chose the solution you did and what alternatives you considered, etc...
All four smoke test synced to processing. Nothing unusual with peer number.