go-ethereum/ethstats
Marius van der Wijden 3faae5defc
ethstats: avoid creating subscriptions on background goroutine (#22587)
This fixes an issue where the ethstats service could crash if geth was
started and then immediately stopped due to an internal error. The
cause of the crash was a nil subscription being returned by the backend,
because the background goroutine creating them was scheduled after
the backend had already shut down.

Moving the creation of subscriptions into the Start method, which runs
synchronously during startup of the node, means the returned subscriptions
can never be 'nil'.

Co-authored-by: Felix Lange <fjl@twurst.com>
Co-authored-by: Martin Holst Swende <martin@swende.se>
2021-03-30 15:52:03 +02:00
..
ethstats.go ethstats: avoid creating subscriptions on background goroutine (#22587) 2021-03-30 15:52:03 +02:00