aboutsummaryrefslogtreecommitdiffstats
path: root/dex/app.go
diff options
context:
space:
mode:
Diffstat (limited to 'dex/app.go')
-rw-r--r--dex/app.go10
1 files changed, 9 insertions, 1 deletions
diff --git a/dex/app.go b/dex/app.go
index d28f5f490..643949aac 100644
--- a/dex/app.go
+++ b/dex/app.go
@@ -49,7 +49,9 @@ type DexconApp struct {
chainLocksInitMu sync.Mutex
chainLocks map[uint32]*sync.RWMutex
- chainLatestRoot map[uint32]*common.Hash
+
+ chainLatestRootMu sync.Mutex
+ chainLatestRoot map[uint32]*common.Hash
}
type notify struct {
@@ -467,10 +469,16 @@ func (d *DexconApp) validateNonce(txs types.Transactions) (map[common.Address]ui
}
func (d *DexconApp) getChainLatestRoot(chainID uint32) *common.Hash {
+ d.chainLatestRootMu.Lock()
+ defer d.chainLatestRootMu.Unlock()
+
return d.chainLatestRoot[chainID]
}
func (d *DexconApp) setChainLatestRoot(chainID uint32, root *common.Hash) {
+ d.chainLatestRootMu.Lock()
+ defer d.chainLatestRootMu.Unlock()
+
d.chainLatestRoot[chainID] = root
}