2
0
mirror of https://github.com/status-im/status-go.git synced 2025-01-10 22:56:40 +00:00

fix_: don't start mailserver cycle when no mailservers set ()

This commit is contained in:
Igor Sirotin 2023-12-19 11:58:44 +00:00 committed by GitHub
parent 45bd8c16da
commit 0818c98fca
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

@ -72,7 +72,7 @@ func (m *Messenger) StartMailserverCycle(mailservers []mailservers.Mailserver) e
switch version {
case 1:
if m.server == nil {
m.logger.Warn("not starting mailserver cycle")
m.logger.Warn("not starting mailserver cycle: no p2p server is set")
return nil
}
@ -81,6 +81,10 @@ func (m *Messenger) StartMailserverCycle(mailservers []mailservers.Mailserver) e
go m.updateWakuV1PeerStatus()
case 2:
if len(mailservers) == 0 {
m.logger.Warn("not starting mailserver cycle: empty mailservers list")
return nil
}
for _, storenode := range mailservers {
_, err := m.transport.AddStorePeer(storenode.Address)
if err != nil {