[3.1 -> main] net_plugin fix startup issue when peer does not have requested blocks #153
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.
Test failure of #115 caused by peer not requesting blocks when no blocks where received from the sync source peer.
Two things contributed to this.
sync_source
because thesync_source
was set to a different connection but no new request was sent. When the connection was closed that this node was expecting blocks from it did not request from a different connection because thesync_source
indicated it was already syncing from a different connection. This caused it not to try a different connection on the close of the sync source connection.Changed to keep
sync_source
up to date with with the connection actually syncing from. This is done by only updatingsync_source
when a request to sync from a peer is made.Also changed to always send a handshake on a block heart beat timeout since there is no harm in sending an extra handshake.
Merges #135 to
main
.Resolves #115