This repository has been archived by the owner on Aug 23, 2020. It is now read-only.
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.
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.
I am trying to think...
Intuitively I would think that there is an
else
is missing above thetry
...This is because this is what the comment says. But let's think critically about this.
If we delete this code it means that if we request a non-existing tx the ping-pong would stop.
If I am a non-synced node and I am getting requests for transactions that I don't have then I won't request transactions that are missing from those nodes, and the ping pong would stop.
However if a neighbor is requesting from me transactions that I don't have then the neighbor is:
In case of (1) it means that I am sending the same transactions over and over again, thus slowing down an not helping with the sync. This will stop the ping pong between them but newly broadcasted txs should liven it up
In case of (2) we obviously shouldn't send a message
As long as there is 1 synced node in the network it should be able to sync the rest of the nodes eventually
So I support deleting and not adding
else