diff options
author | Bojie Wu <bojie@dexon.org> | 2018-10-09 13:28:45 +0800 |
---|---|---|
committer | Wei-Ning Huang <w@dexon.org> | 2018-12-19 20:54:27 +0800 |
commit | 72d5692ead48a75e82182a42dd4443b2288491d2 (patch) | |
tree | 472ee096d03084a60287c11bf04733f775f28bd5 /dex/app.go | |
parent | 543d6a6c2b9959f519bf4283e1b9e752c961419a (diff) | |
download | dexon-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.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) } |