swarm/network: fix data race on TestService bucket caused by copying struct content without synchronisation

This commit is contained in:
Elad Nachmias 2019-01-16 20:44:50 +05:30
parent 4aeeecfded
commit 1b916f89c1

View file

@ -73,8 +73,7 @@ func NewEvent(v interface{}) *Event {
switch v := v.(type) { switch v := v.(type) {
case *Node: case *Node:
event.Type = EventTypeNode event.Type = EventTypeNode
node := *v event.Node = v
event.Node = &node
case *Conn: case *Conn:
event.Type = EventTypeConn event.Type = EventTypeConn
conn := *v conn := *v