Commit 99fb481c authored by suyanlong's avatar suyanlong

fixed RegisterConnectHandler function

parent 5eefc718
......@@ -42,9 +42,9 @@ func (swarm *Swarm) registerMsgHandler(messageType pb.Message_Type, handler inte
}
func (swarm *Swarm) RegisterConnectHandler(handler ConnectHandler) error {
//swarm.lock.Lock()
//defer swarm.lock.Unlock()
//swarm.connectHandlers = append(swarm.connectHandlers, handler)
//return nil
panic("Unimplemented!")
swarm.lock.Lock()
defer swarm.lock.Unlock()
swarm.connectHandlers = append(swarm.connectHandlers, handler)
return nil
//panic("Unimplemented!")
}
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment