Merge pull request #2136 from cpuguy83/fix_map_access_panic_ndb

networkdb: Use write lock in handleNodeEvent
This commit is contained in:
Madhu Venugopal 2018-04-11 20:31:03 -07:00 committed by GitHub
commit 9c2e855b71
1 changed files with 2 additions and 2 deletions

View File

@ -21,8 +21,8 @@ func (nDB *NetworkDB) handleNodeEvent(nEvent *NodeEvent) bool {
// time.
nDB.networkClock.Witness(nEvent.LTime)
nDB.RLock()
defer nDB.RUnlock()
nDB.Lock()
defer nDB.Unlock()
// check if the node exists
n, _, _ := nDB.findNode(nEvent.NodeName)