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-03-12 12:19:09 +0800
commit5853525cb0de7bfa03029342e2427e2b929da9da (patch)
treec37e9824fc63b1ceeba73f9524b92f3de5037690 /dex
parent7e1378c7bf7f8b34b8ed3d197143a2fb6c98a5d9 (diff)
downloaddexon-5853525cb0de7bfa03029342e2427e2b929da9da.tar.gz
dexon-5853525cb0de7bfa03029342e2427e2b929da9da.tar.zst
dexon-5853525cb0de7bfa03029342e2427e2b929da9da.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 {