From 911794dd69163dffa7cc8eb8b3ab102097cc0c9a Mon Sep 17 00:00:00 2001 From: Robin Lai Date: Fri, 7 Feb 2020 11:47:22 -0800 Subject: [PATCH] rm some unnecessary lock --- core/commands/storage/session.go | 12 ------------ 1 file changed, 12 deletions(-) diff --git a/core/commands/storage/session.go b/core/commands/storage/session.go index d751ff38a..816a315c4 100644 --- a/core/commands/storage/session.go +++ b/core/commands/storage/session.go @@ -345,9 +345,6 @@ func (ss *FileContracts) SetFileHash(fileHash cidlib.Cid) { } func (ss *FileContracts) GetFileHash() cidlib.Cid { - ss.Lock() - defer ss.Unlock() - return ss.FileHash } @@ -402,9 +399,6 @@ func (ss *FileContracts) SetStatusWithError(status int, err error) { } func (ss *FileContracts) GetStatusAndMessage() (string, string) { - ss.Lock() - defer ss.Unlock() - return ss.Status, ss.StatusMessage } @@ -554,16 +548,10 @@ func (c *Shard) SetState(state int) { } func (c *Shard) GetStateStr() string { - c.Lock() - defer c.Unlock() - return StdStateFlow[c.State].State } func (c *Shard) GetState() int { - c.Lock() - defer c.Unlock() - return c.State }