mirror of
https://github.com/yggdrasil-network/yggdrasil-go.git
synced 2025-04-28 22:25:07 +03:00
more peer migration
This commit is contained in:
parent
775fb535dc
commit
88161009e9
3 changed files with 11 additions and 7 deletions
|
@ -64,11 +64,8 @@ func (r *router) init(core *Core) {
|
|||
},
|
||||
}
|
||||
p := r.core.peers.newPeer(&r.core.boxPub, &r.core.sigPub, &crypto.BoxSharedKey{}, &self, nil)
|
||||
p.out = func(packets [][]byte) {
|
||||
// TODO make peers and/or the switch into actors, have them pass themselves as the from field
|
||||
r.handlePackets(nil, packets)
|
||||
}
|
||||
r.out = p.handlePacket // TODO if the peer becomes its own actor, then send a message here
|
||||
p.out = func(packets [][]byte) { r.handlePackets(p, packets) }
|
||||
r.out = func(bs []byte) { p.handlePacketFrom(r, bs) }
|
||||
r.nodeinfo.init(r.core)
|
||||
r.core.config.Mutex.RLock()
|
||||
r.nodeinfo.setNodeInfo(r.core.config.Current.NodeInfo, r.core.config.Current.NodeInfoPrivacy)
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue