From ecd23ce9fc1e46c016697c4ac945162b9fb159e5 Mon Sep 17 00:00:00 2001 From: Arceliar Date: Sat, 24 Aug 2019 12:59:20 -0500 Subject: [PATCH] safer linkloop --- src/yggdrasil/peer.go | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/yggdrasil/peer.go b/src/yggdrasil/peer.go index 22db88d1..8c38c06a 100644 --- a/src/yggdrasil/peer.go +++ b/src/yggdrasil/peer.go @@ -213,7 +213,7 @@ func (p *peer) linkLoop() { case dinfo = <-p.dinfo: case _ = <-tick.C: if dinfo != nil { - p.core.router.insertPeer(nil, dinfo) + <-p.SyncExec(func() { p.core.router.insertPeer(p, dinfo) }) } } }