Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Prevent panicking when fetching without any peers (spacemeshos#4657)
## Motivation There was a debug panic that was not removed from spacemeshos#4374, and also `randomPeer()` would fatally exit if there were no peers. We don't actually want to panic, when trying to service a fetch request and there are no peers, so now we check to see if we have no peers and simply return, the fetch operation is performed on a ticker and so will be re-executed after some period. ## DevOps Notes <!-- Please uncheck these items as applicable to make DevOps aware of changes that may affect releases --> - [x] This PR does not require configuration changes (e.g., environment variables, GitHub secrets, VM resources) - [x] This PR does not affect public APIs - [x] This PR does not rely on a new version of external services (PoET, elasticsearch, etc.) - [x] This PR does not make changes to log messages (which monitoring infrastructure may rely on)
- Loading branch information