fix(orhpan-chain): verify node is synced before checking if it's orphan chain #1091
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.
Description
Check if node is synced before validating block hash against text explorer and fix bug where warning was shown even after node was no longer an orphan chain or when user had no internet connection.
Motivation and Context
Many users reported false positive where they had warning but they were sure it wasn't the case. This could be achieved if user disconnected internet connection and connected again.
How Has This Been Tested?
Disconnect WiFi, while disconnected there should be no warning.
Turn off Tor and check if there any peers connected - if not it means you are on the orphan chain.
Wait a while to mine some block and warning should pop up (It could take a while depending on the mining speed). You can also compare block height with the text explorer (the tip in the explorer should be higher)
What process can a PR reviewer use to test or verify this change?
Same as above.
Breaking Changes