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

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
1 changed files with 5 additions and 1 deletions

View File

@ -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 {