fix: temp cast mediator so we can set the service data

This commit is contained in:
Derrick Hammer 2024-01-30 16:00:41 -05:00
parent 9919ad72da
commit 5a2e28faba
Signed by: pcfreak30
GPG Key ID: C997C339BE476FF2
1 changed files with 6 additions and 0 deletions

View File

@ -446,6 +446,12 @@ func (p *P2PServiceDefault) OnNewPeerListen(peer net.Peer, verifyId bool) {
}), }),
} }
if mediator, ok := data.Mediator.(service.Service); ok {
mediator.SetServices(p.Services())
} else {
p.Logger().Fatal("failed to cast mediator to service.Service")
}
dec := msgpack.NewDecoder(bytes.NewReader(reader.Data)) dec := msgpack.NewDecoder(bytes.NewReader(reader.Data))
err = handler.DecodeMessage(dec, data) err = handler.DecodeMessage(dec, data)