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@byzantine-lab.io>2019-06-12 17:27:17 +0800
commit3c14b7b9b2664476dd661cb332bd107418f42a09 (patch)
treea5dac1b3af6020e238baa1cb0ab40fd78dbb079a /dex
parent33db8ae235b072d4b6483ea9fea68e19e5383dce (diff)
downloadgo-tangerine-3c14b7b9b2664476dd661cb332bd107418f42a09.tar.gz
go-tangerine-3c14b7b9b2664476dd661cb332bd107418f42a09.tar.zst
go-tangerine-3c14b7b9b2664476dd661cb332bd107418f42a09.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 {