aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorJimmy Hu <jimmy.hu@dexon.org>2019-01-04 17:14:00 +0800
committerWei-Ning Huang <w@dexon.org>2019-04-09 21:32:55 +0800
commit9db3e9124a4153cd45e8444bd844efcd3955e38d (patch)
tree6386c6afb26d28ed981ffea3df0a63d276293c7c
parent4902142388ec53dc8f1a33fee88ff3e31a5aed84 (diff)
downloaddexon-9db3e9124a4153cd45e8444bd844efcd3955e38d.tar.gz
dexon-9db3e9124a4153cd45e8444bd844efcd3955e38d.tar.zst
dexon-9db3e9124a4153cd45e8444bd844efcd3955e38d.zip
dex: fix cache error (#126)
-rw-r--r--dex/cache.go1
1 files changed, 1 insertions, 0 deletions
diff --git a/dex/cache.go b/dex/cache.go
index bdc22e114..5d4d20dd0 100644
--- a/dex/cache.go
+++ b/dex/cache.go
@@ -71,6 +71,7 @@ func (c *cache) addVote(vote *coreTypes.Vote) {
pos := c.votePosition[0]
c.voteSize -= len(c.voteCache[pos])
delete(c.voteCache, pos)
+ c.votePosition = c.votePosition[1:]
}
if _, exist := c.voteCache[vote.Position]; !exist {
c.votePosition = append(c.votePosition, vote.Position)