fix: dropping peer in mailserver cycle

This commit is contained in:
Richard Ramos 2023-01-18 09:10:11 -04:00 committed by RichΛrd
parent 4406931582
commit 8fd291f27c
2 changed files with 6 additions and 5 deletions

View File

@ -108,7 +108,8 @@ func (m *Messenger) disconnectMailserver() error {
if err != nil { if err != nil {
return err return err
} }
err = m.transport.DropPeer(string(*peerID))
err = m.transport.DropPeer(peerID.String())
if err != nil { if err != nil {
m.logger.Warn("could not drop peer") m.logger.Warn("could not drop peer")
return err return err

View File

@ -46,17 +46,17 @@ func (m Mailserver) IDBytes() ([]byte, error) {
return node.ID().Bytes(), nil return node.ID().Bytes(), nil
} }
func (m Mailserver) PeerID() (*peer.ID, error) { func (m Mailserver) PeerID() (peer.ID, error) {
if m.Version != 2 { if m.Version != 2 {
return nil, errors.New("not available") return "", errors.New("not available")
} }
pID, err := peer.Decode(m.UniqueID()) pID, err := peer.Decode(m.UniqueID())
if err != nil { if err != nil {
return nil, err return "", err
} }
return &pID, nil return pID, nil
} }
func (m Mailserver) UniqueID() string { func (m Mailserver) UniqueID() string {