Fix failing test case because of wrong TimeOffset #543
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.
In rare cases, the build fails with the error:
https://travis-ci.org/btcsuite/btcd/jobs/87692240#L542
One reason this might happen is when the current timestamp is
1s
ahead of the message timestamp and the tick happens when the message is in transit.Since the protocol is limited to one second precision, we do not have enough data to compare the timestamps any further. Therefore, I guess there will be some peer connections which inadvertently have an offset of
1s
. Updated the test case to handle this.