mirror of
https://gitlab.com/pulsechaincom/erigon-pulse.git
synced 2024-12-22 19:50:36 +00:00
Fix defer order to prevent concurrent map write panic (#6736)
Co-authored-by: Alexey Sharp <alexeysharp@Alexeys-iMac.local>
This commit is contained in:
parent
939587bdab
commit
0ccda84439
@ -241,9 +241,9 @@ func (fv *ForkValidator) clear() {
|
||||
|
||||
// TryAddingPoWBlock adds a PoW block to the fork validator if possible
|
||||
func (fv *ForkValidator) TryAddingPoWBlock(block *types.Block) {
|
||||
defer fv.clean()
|
||||
fv.lock.Lock()
|
||||
defer fv.lock.Unlock()
|
||||
defer fv.clean()
|
||||
fv.sideForksBlock[block.Hash()] = types.RawBlock{Header: block.Header(), Body: block.RawBody()}
|
||||
}
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user