mirror of
https://github.com/ethereum/go-ethereum.git
synced 2026-08-20 10:52:25 +00:00
core : fix quit channel goroutine leak
This commit is contained in:
parent
f7b29ec942
commit
8e46c4649a
3 changed files with 4 additions and 4 deletions
|
|
@ -215,7 +215,7 @@ func NewBlockChain(db ethdb.Database, cacheConfig *CacheConfig, chainConfig *par
|
|||
db: db,
|
||||
triegc: prque.New(nil),
|
||||
stateCache: state.NewDatabaseWithCache(db, cacheConfig.TrieCleanLimit),
|
||||
quit: make(chan struct{}),
|
||||
quit: make(chan struct{}, 1),
|
||||
shouldPreserve: shouldPreserve,
|
||||
bodyCache: bodyCache,
|
||||
bodyRLPCache: bodyRLPCache,
|
||||
|
|
|
|||
|
|
@ -154,8 +154,8 @@ func (m *Matcher) Start(ctx context.Context, begin, end uint64, results chan uin
|
|||
// Initiate a new matching round
|
||||
session := &MatcherSession{
|
||||
matcher: m,
|
||||
quit: make(chan struct{}),
|
||||
kill: make(chan struct{}),
|
||||
quit: make(chan struct{}, 1),
|
||||
kill: make(chan struct{}, 1),
|
||||
ctx: ctx,
|
||||
}
|
||||
for _, scheduler := range m.schedulers {
|
||||
|
|
|
|||
|
|
@ -44,7 +44,7 @@ func InitDatabaseFromFreezer(db ethdb.Database) error {
|
|||
number = ^uint64(0) // -1
|
||||
results = make(chan *types.Block, 4*runtime.NumCPU())
|
||||
)
|
||||
abort := make(chan struct{})
|
||||
abort := make(chan struct{}, 1)
|
||||
defer close(abort)
|
||||
|
||||
for i := 0; i < runtime.NumCPU(); i++ {
|
||||
|
|
|
|||
Loading…
Reference in a new issue