mirror of https://github.com/status-im/op-geth.git
56ed6152a1
Shutting down geth prints hundreds of annoying error messages in some cases. The errors appear because the Stop method of eth.ProtocolManager, miner.Miner and core.TxPool is asynchronous. Left over peer sessions generate events which are processed after Stop even though the database has already been closed. The fix is to make Stop synchronous using sync.WaitGroup. For eth.ProtocolManager, in order to make use of WaitGroup safe, we need a way to stop new peer sessions from being added while waiting on the WaitGroup. The eth protocol Run function now selects on a signaling channel and adds to the WaitGroup only if ProtocolManager is not shutting down. For miner.worker and core.TxPool the number of goroutines is static, WaitGroup can be used in the usual way without additional synchronisation. |
||
---|---|---|
.. | ||
state | ||
types | ||
vm | ||
.gitignore | ||
asm.go | ||
bad_block.go | ||
bench_test.go | ||
block_validator.go | ||
block_validator_test.go | ||
blockchain.go | ||
blockchain_test.go | ||
blocks.go | ||
chain_makers.go | ||
chain_makers_test.go | ||
chain_pow.go | ||
chain_pow_test.go | ||
config.go | ||
database_util.go | ||
database_util_test.go | ||
default_genesis.go | ||
error.go | ||
events.go | ||
execution.go | ||
fees.go | ||
filter_test.go | ||
gaspool.go | ||
genesis.go | ||
headerchain.go | ||
helper_test.go | ||
state_processor.go | ||
state_transition.go | ||
tx_pool.go | ||
tx_pool_test.go | ||
types.go | ||
vm_env.go |