Skip to content

Commit

Permalink
[R4R] fix:defer bloomprocessor close (#860)
Browse files Browse the repository at this point in the history
* fix:defer bloomprocessor close

* fix: fix deadlock in Close

* perf:rm defer bloomprocessors Close and manual close before return
  • Loading branch information
qinglin89 authored Apr 28, 2022
1 parent 15bc254 commit 717b38c
Showing 1 changed file with 3 additions and 0 deletions.
3 changes: 3 additions & 0 deletions core/state_processor.go
Original file line number Diff line number Diff line change
Expand Up @@ -410,6 +410,7 @@ func (p *StateProcessor) Process(block *types.Block, statedb *state.StateDB, cfg
for i, tx := range block.Transactions() {
if isPoSA {
if isSystemTx, err := posa.IsSystemTransaction(tx, block.Header()); err != nil {
bloomProcessors.Close()
return statedb, nil, nil, 0, err
} else if isSystemTx {
systemTxs = append(systemTxs, tx)
Expand All @@ -419,11 +420,13 @@ func (p *StateProcessor) Process(block *types.Block, statedb *state.StateDB, cfg

msg, err := tx.AsMessage(signer)
if err != nil {
bloomProcessors.Close()
return statedb, nil, nil, 0, err
}
statedb.Prepare(tx.Hash(), block.Hash(), i)
receipt, err := applyTransaction(msg, p.config, p.bc, nil, gp, statedb, header, tx, usedGas, vmenv, bloomProcessors)
if err != nil {
bloomProcessors.Close()
return statedb, nil, nil, 0, fmt.Errorf("could not apply tx %d [%v]: %w", i, tx.Hash().Hex(), err)
}

Expand Down

0 comments on commit 717b38c

Please sign in to comment.