use RWMutex for router channel lookup

This commit is contained in:
David Zhao
2021-04-06 17:16:55 -07:00
parent e940c5d8ab
commit 144351a89a
2 changed files with 7 additions and 7 deletions
+1 -1
View File
@@ -12,7 +12,7 @@ import (
// a router of messages on the same node, basic implementation for local testing
type LocalRouter struct {
currentNode LocalNode
lock sync.Mutex
lock sync.RWMutex
// channels for each participant
requestChannels map[string]*MessageChannel
responseChannels map[string]*MessageChannel