mirror of
https://github.com/status-im/status-go.git
synced 2025-01-17 18:22:13 +00:00
fix_: no peers available supporting LightPush protocol after network restored from disabled state (#6153)
Fix: - https://github.com/status-im/status-mobile/issues/21452 - https://github.com/status-im/status-mobile/issues/21394 Might also fix part (missing messages) of https://github.com/status-im/status-mobile/issues/21172 Related mobile PR https://github.com/status-im/status-mobile/pull/21730
This commit is contained in:
parent
9a94a82fd6
commit
55befd839e
@ -1705,7 +1705,15 @@ func (w *Waku) handleNetworkChangeFromApp(state connection.State) {
|
||||
}
|
||||
}
|
||||
|
||||
func (w *Waku) isGoingOnline(state connection.State) bool {
|
||||
return !state.Offline && !w.onlineChecker.IsOnline()
|
||||
}
|
||||
|
||||
func (w *Waku) ConnectionChanged(state connection.State) {
|
||||
if w.isGoingOnline(state) {
|
||||
//TODO: analyze if we need to discover and connect to peers for relay.
|
||||
w.discoverAndConnectPeers()
|
||||
}
|
||||
isOnline := !state.Offline
|
||||
if w.cfg.LightClient {
|
||||
//TODO: Update this as per https://github.com/waku-org/go-waku/issues/1114
|
||||
@ -1716,10 +1724,7 @@ func (w *Waku) ConnectionChanged(state connection.State) {
|
||||
w.handleNetworkChangeFromApp(state)
|
||||
} else {
|
||||
// for lightClient state update and onlineChange is handled in filterManager.
|
||||
// going online
|
||||
if isOnline && !w.onlineChecker.IsOnline() {
|
||||
//TODO: analyze if we need to discover and connect to peers for relay.
|
||||
w.discoverAndConnectPeers()
|
||||
if w.isGoingOnline(state) {
|
||||
select {
|
||||
case w.goingOnline <- struct{}{}:
|
||||
default:
|
||||
|
Loading…
x
Reference in New Issue
Block a user