aboutsummaryrefslogtreecommitdiffstats
path: root/dex
diff options
context:
space:
mode:
authorJimmy Hu <jimmy.hu@dexon.org>2018-11-03 01:22:19 +0800
committerWei-Ning Huang <w@dexon.org>2019-04-09 21:32:52 +0800
commit7287da82d3f472b713b557fa4f55efd48876cef2 (patch)
treee6bdba6bf0690112889519e6b9ee71fc7727d7a8 /dex
parent8ed22ce9b93ca33e1350a209164df1cb648047b2 (diff)
downloaddexon-7287da82d3f472b713b557fa4f55efd48876cef2.tar
dexon-7287da82d3f472b713b557fa4f55efd48876cef2.tar.gz
dexon-7287da82d3f472b713b557fa4f55efd48876cef2.tar.bz2
dexon-7287da82d3f472b713b557fa4f55efd48876cef2.tar.lz
dexon-7287da82d3f472b713b557fa4f55efd48876cef2.tar.xz
dexon-7287da82d3f472b713b557fa4f55efd48876cef2.tar.zst
dexon-7287da82d3f472b713b557fa4f55efd48876cef2.zip
dex: remove finalization information in block cache
Diffstat (limited to 'dex')
-rw-r--r--dex/cache.go2
1 files changed, 2 insertions, 0 deletions
diff --git a/dex/cache.go b/dex/cache.go
index e56e706f9..96ba2d765 100644
--- a/dex/cache.go
+++ b/dex/cache.go
@@ -92,6 +92,8 @@ func (c *cache) votes(pos coreTypes.Position) []*coreTypes.Vote {
func (c *cache) addBlock(block *coreTypes.Block) {
c.lock.Lock()
defer c.lock.Unlock()
+ block = block.Clone()
+ block.Finalization.Height = 0
if len(c.blockCache) >= c.size {
// Randomly delete one entry.
for k := range c.blockCache {