Skip to content
This repository has been archived by the owner on Aug 16, 2021. It is now read-only.

[FN] Additional handling for malformed peers.json #4192

Merged
merged 3 commits into from
Jul 28, 2020

Conversation

zeptin
Copy link
Contributor

@zeptin zeptin commented Jul 20, 2020

I have carefully re-reviewed the logic around peer discovery; I do not actually see how a node with acceptable network connectivity can remain without peers for an extended period even if the peers.json somehow got corrupted.

Nevertheless, this traps for any exceptions (if the deserialisation of the JSON happens to throw any - this is somewhat doubtful), and initialises an empty list if the deserialised object is ever null.

The expected behaviour if this occurs is that the PeerDiscoveryLoop will in any case run almost immediately after startup and determine that there are no known peers. It will then add the DNS seeds & seed nodes as discovery candidates, which should elicit some connectable peers.

@zeptin zeptin requested a review from fassadlr July 20, 2020 22:13
@StratisIain StratisIain reopened this Jul 22, 2020
@zeptin zeptin requested a review from codingupastorm July 22, 2020 21:00
@zeptin zeptin merged commit 3d71c37 into stratisproject:master Jul 28, 2020
@zeptin zeptin deleted the peersjson branch July 28, 2020 23:21
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants