aboutsummaryrefslogtreecommitdiffstats
path: root/dex
diff options
context:
space:
mode:
authorBojie Wu <bojie@dexon.org>2018-10-09 13:28:45 +0800
committerWei-Ning Huang <w@dexon.org>2019-03-12 12:19:09 +0800
commit947a2b720d966efae8aa8564cbe948f8eb6d5d38 (patch)
tree34f483d644a825698cd62a2733e37d6f64c76ca3 /dex
parent273e978574e459fcfec1e3ae62b3f7b335581c88 (diff)
downloaddexon-947a2b720d966efae8aa8564cbe948f8eb6d5d38.tar
dexon-947a2b720d966efae8aa8564cbe948f8eb6d5d38.tar.gz
dexon-947a2b720d966efae8aa8564cbe948f8eb6d5d38.tar.bz2
dexon-947a2b720d966efae8aa8564cbe948f8eb6d5d38.tar.lz
dexon-947a2b720d966efae8aa8564cbe948f8eb6d5d38.tar.xz
dexon-947a2b720d966efae8aa8564cbe948f8eb6d5d38.tar.zst
dexon-947a2b720d966efae8aa8564cbe948f8eb6d5d38.zip
app: add mutex to prevent concurrent read write map
Diffstat (limited to 'dex')
-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)
}