diff options
author | Bojie Wu <bojie@dexon.org> | 2018-10-09 13:28:45 +0800 |
---|---|---|
committer | Wei-Ning Huang <w@dexon.org> | 2019-04-09 13:49:55 +0800 |
commit | 4f6fd5ba3e1fb9e66fa099e2f8bb275388c1f388 (patch) | |
tree | 7ffc08cdd00931c47996d81241f44e183bbb4ea4 | |
parent | 99d7c99a0a0b1e2cdf9158bc4c943916403a2726 (diff) | |
download | dexon-4f6fd5ba3e1fb9e66fa099e2f8bb275388c1f388.tar dexon-4f6fd5ba3e1fb9e66fa099e2f8bb275388c1f388.tar.gz dexon-4f6fd5ba3e1fb9e66fa099e2f8bb275388c1f388.tar.bz2 dexon-4f6fd5ba3e1fb9e66fa099e2f8bb275388c1f388.tar.lz dexon-4f6fd5ba3e1fb9e66fa099e2f8bb275388c1f388.tar.xz dexon-4f6fd5ba3e1fb9e66fa099e2f8bb275388c1f388.tar.zst dexon-4f6fd5ba3e1fb9e66fa099e2f8bb275388c1f388.zip |
app: add mutex to prevent concurrent read write map
-rw-r--r-- | dex/app.go | 3 |
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) } |