aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorJimmy Hu <jimmy.hu@dexon.org>2018-11-03 01:22:19 +0800
committerWei-Ning Huang <w@dexon.org>2018-12-19 20:54:27 +0800
commit97e7b84bc5a3297808adfa9564da60f1feb0f12f (patch)
treec42d96eaa209aa6e658cf8f3f63e7c13f937b64e
parent148806a698d1e65894cc00fcf855fa5bf062277d (diff)
downloaddexon-97e7b84bc5a3297808adfa9564da60f1feb0f12f.tar.gz
dexon-97e7b84bc5a3297808adfa9564da60f1feb0f12f.tar.zst
dexon-97e7b84bc5a3297808adfa9564da60f1feb0f12f.zip
dex: remove finalization information in block cache
-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 {