mirror of
https://github.com/ethereum/go-ethereum.git
synced 2026-08-10 22:13:47 +00:00
should use Lock when mutating the flag
This commit is contained in:
parent
930c946388
commit
dfe484d6a2
1 changed files with 2 additions and 2 deletions
|
|
@ -166,13 +166,13 @@ func (mv *MVHashMap) MarkEstimate(k Key, txIdx int) {
|
||||||
panic(fmt.Errorf("path must already exist"))
|
panic(fmt.Errorf("path must already exist"))
|
||||||
})
|
})
|
||||||
|
|
||||||
cells.rw.RLock()
|
cells.rw.Lock()
|
||||||
if ci, ok := cells.tm.Get(txIdx); !ok {
|
if ci, ok := cells.tm.Get(txIdx); !ok {
|
||||||
panic(fmt.Sprintf("should not happen - cell should be present for path. TxIdx: %v, path, %x, cells keys: %v", txIdx, k, cells.tm.Keys()))
|
panic(fmt.Sprintf("should not happen - cell should be present for path. TxIdx: %v, path, %x, cells keys: %v", txIdx, k, cells.tm.Keys()))
|
||||||
} else {
|
} else {
|
||||||
ci.(*WriteCell).flag = FlagEstimate
|
ci.(*WriteCell).flag = FlagEstimate
|
||||||
}
|
}
|
||||||
cells.rw.RUnlock()
|
cells.rw.Unlock()
|
||||||
}
|
}
|
||||||
|
|
||||||
func (mv *MVHashMap) Delete(k Key, txIdx int) {
|
func (mv *MVHashMap) Delete(k Key, txIdx int) {
|
||||||
|
|
|
||||||
Loading…
Reference in a new issue