aboutsummaryrefslogtreecommitdiffstats
path: root/rpc
diff options
context:
space:
mode:
authorobscuren <geffobscura@gmail.com>2015-02-15 09:12:14 +0800
committerobscuren <geffobscura@gmail.com>2015-02-15 09:13:24 +0800
commit09e53367a24025564686af42c8349d2bd05729c3 (patch)
tree13895b4f838afe5c04d87149cc79d54006f2e32b /rpc
parentb143dad596f4230d74dadd3c5060020bd50ef7f3 (diff)
downloaddexon-09e53367a24025564686af42c8349d2bd05729c3.tar.gz
dexon-09e53367a24025564686af42c8349d2bd05729c3.tar.zst
dexon-09e53367a24025564686af42c8349d2bd05729c3.zip
Use a mutex write-lock for a write operation
Diffstat (limited to 'rpc')
-rw-r--r--rpc/packages.go8
1 files changed, 4 insertions, 4 deletions
diff --git a/rpc/packages.go b/rpc/packages.go
index ac3127356..ef31ff1e1 100644
--- a/rpc/packages.go
+++ b/rpc/packages.go
@@ -109,8 +109,8 @@ func (self *EthereumApi) NewFilterString(args string, reply *interface{}) error
}
func (self *EthereumApi) FilterChanged(id int, reply *interface{}) error {
- self.logMut.RLock()
- defer self.logMut.RUnlock()
+ self.logMut.Lock()
+ defer self.logMut.Unlock()
*reply = toLogs(self.logs[id])
@@ -309,8 +309,8 @@ func (p *EthereumApi) NewWhisperFilter(args *xeth.Options, reply *interface{}) e
}
func (self *EthereumApi) MessagesChanged(id int, reply *interface{}) error {
- self.messagesMut.RLock()
- defer self.messagesMut.RUnlock()
+ self.messagesMut.Lock()
+ defer self.messagesMut.Unlock()
*reply = self.messages[id]