[Fix] Improve peer bootstrap connections
Description
Restore healthy bootstrap behaviour after the stash fix by letting
Peer.OnTimer() pull a fuller batch of seed peers before honoring low
MinDesiredConnections. That way private-net consensus still converges
without depending on the accidental disconnects the race condition used to
cause.
Fixes # N/A
Type of change
- [x] Bug fix (non-breaking change which fixes an issue)
- [ ] Optimization (the change is only an optimization)
- [ ] Style (the change is only a code style for better maintenance or standard purpose)
- [ ] New feature (non-breaking change which adds functionality)
- [ ] Breaking change (fix or feature that would cause existing functionality to not work as expected)
- [ ] This change requires a documentation update
Test Configuration:
dotnet test tests/Neo.UnitTests/Neo.UnitTests.csproj -c Release (fails
before running: MSBuild cannot bind its named pipe in this sandbox—
SocketException (permission denied)).
Checklist:
- [x] My code follows the style guidelines of this project
- [x] I have performed a self-review of my code
- [ ] I have commented my code, particularly in hard-to-understand areas
- [ ] I have made corresponding changes to the documentation
- [x] My changes generate no new warnings
- [ ] I have added tests that prove my fix is effective or that my feature works
- [ ] New and existing unit tests pass locally with my changes
- [x] Any dependent changes have been merged and published in downstream modules
The fix looks good @Jim8y, there are some checks and parameters that could improve and some are a little strange to me.
i checked your comments, many of them are reasonable range checks, will udpate.
Could you rebase to master @Jim8y ?
To master