pravahio / go-mesh

Realtime data exchange platform for Smart Cities
https://pravah.io
MIT License
25 stars 5 forks source link

delay announceAndFind till we get connected to bootstrap nodes #5

Closed upperwal closed 5 years ago

upperwal commented 5 years ago

AnnounceAndFind is called even if connectToBootstrapPeers is still trying connecting. This might not announce or discover nodes at all.

https://github.com/upperwal/go-mesh/blob/8e4a9f181fbe7a63be06ee0031b1829195979dfc/service/bootstrap/connection.go#L18-L20

upperwal commented 5 years ago

It turns out app was not stuck due to bs.AnnounceAndFind. Instead connectToBootstrapPeers is not handling errors properly and hence AnnounceAndFind is called.

Commit a394e24f3f38e8ac17925368972e0acfef73d805 is now handling the error and app is logging it.