plugeth/core
Felix Lange 56ed6152a1 core, eth, miner: improve shutdown synchronisation
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.
2016-05-09 13:03:08 +02:00
..
state all: fix go vet warnings 2016-04-15 11:17:27 +02:00
types core, core/types, eth: add and use Block.Body 2016-04-15 10:57:37 +02:00
vm all: fix go vet warnings 2016-04-15 11:17:27 +02:00
.gitignore Renamed chain => core 2014-12-04 10:28:02 +01:00
asm.go all: fix go vet warnings 2016-04-15 11:17:27 +02:00
bad_block.go all: fix license headers one more time 2015-07-23 18:35:11 +02:00
bench_test.go core: added basic chain configuration 2016-04-01 01:01:10 +02:00
block_validator_test.go accounts/a/b/backends, core: chain maker homestead block set to 0 2016-04-01 01:01:10 +02:00
block_validator.go all: update license information 2016-04-15 09:48:05 +02:00
blockchain_test.go accounts/a/b/backends, core: chain maker homestead block set to 0 2016-04-01 01:01:10 +02:00
blockchain.go core: Provide a public accessor for ChainConfig 2016-04-29 12:42:03 +01:00
blocks.go remove 0x 2015-08-20 18:50:47 +02:00
chain_makers_test.go accounts/a/b/backends, core: chain maker homestead block set to 0 2016-04-01 01:01:10 +02:00
chain_makers.go accounts/a/b/backends, core: chain maker homestead block set to 0 2016-04-01 01:01:10 +02:00
chain_pow_test.go core, eth: receipt chain reconstruction 2015-10-19 10:03:09 +03:00
chain_pow.go core: separate and contain POW verifier, extensive tests 2015-09-21 10:24:49 +03:00
config.go core: added basic chain configuration 2016-04-01 01:01:10 +02:00
database_util_test.go core, core/types, eth: add and use Block.Body 2016-04-15 10:57:37 +02:00
database_util.go core, core/types, eth: add and use Block.Body 2016-04-15 10:57:37 +02:00
default_genesis.go all: update license information 2016-04-15 09:48:05 +02:00
error.go Merge pull request #1889 from karalabe/fast-sync-rebase 2015-10-21 11:44:22 -07:00
events.go core, miner: add PendingStateEvent to track non-log updates 2016-02-29 11:24:58 +02:00
execution.go core: added basic chain configuration 2016-04-01 01:01:10 +02:00
fees.go Merge pull request #1515 from fjl/license-fixes 2015-07-28 04:29:42 -07:00
filter_test.go all: fix license headers one more time 2015-07-23 18:35:11 +02:00
gaspool.go all: update license information 2016-04-15 09:48:05 +02:00
genesis.go core, eth: added json tag field for proper unmarshalling 2016-04-25 12:48:31 +02:00
headerchain.go all: update license information 2016-04-15 09:48:05 +02:00
helper_test.go cmd/geth, cmd/utils, core, rpc: renamed to blockchain 2015-10-04 01:13:56 +02:00
state_processor.go all: update license information 2016-04-15 09:48:05 +02:00
state_transition.go core: transition db now also returns the required gas amount 2016-04-01 01:01:10 +02:00
tx_pool_test.go core: added basic chain configuration 2016-04-01 01:01:10 +02:00
tx_pool.go core, eth, miner: improve shutdown synchronisation 2016-05-09 13:03:08 +02:00
types.go all: update license information 2016-04-15 09:48:05 +02:00
vm_env.go core: added basic chain configuration 2016-04-01 01:01:10 +02:00