tari-project / universe

Other
11 stars 24 forks source link

fix(orhpan-chain): verify node is synced before checking if it's orphan chain #1091

Closed MCozhusheck closed 1 week ago

MCozhusheck commented 1 week ago

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