aboutsummaryrefslogtreecommitdiffstats
path: root/dex/app.go
diff options
context:
space:
mode:
authorBojie Wu <bojie@dexon.org>2018-10-09 13:28:45 +0800
committerWei-Ning Huang <w@dexon.org>2018-12-19 20:54:27 +0800
commit72d5692ead48a75e82182a42dd4443b2288491d2 (patch)
tree472ee096d03084a60287c11bf04733f775f28bd5 /dex/app.go
parent543d6a6c2b9959f519bf4283e1b9e752c961419a (diff)
downloaddexon-72d5692ead48a75e82182a42dd4443b2288491d2.tar.gz
dexon-72d5692ead48a75e82182a42dd4443b2288491d2.tar.zst
dexon-72d5692ead48a75e82182a42dd4443b2288491d2.zip
app: add mutex to prevent concurrent read write map
Diffstat (limited to 'dex/app.go')
-rw-r--r--dex/app.go3
1 files changed, 3 insertions, 0 deletions
diff --git a/dex/app.go b/dex/app.go
index 5193fdfb8..867c10361 100644
--- a/dex/app.go
+++ b/dex/app.go
@@ -496,6 +496,9 @@ func (d *DexconApp) BlockDelivered(blockHash coreCommon.Hash, result coreTypes.F
// BlockConfirmed is called when a block is confirmed and added to lattice.
func (d *DexconApp) BlockConfirmed(block coreTypes.Block) {
+ d.insertMu.Lock()
+ defer d.insertMu.Unlock()
+
d.blockchain.AddConfirmedBlock(&block)
}