Merge #12367: Fix two fast-shutdown bugs
Summary:
dd2de47 Fix fast-shutdown crash if genesis block was not loaded (Matt Corallo)
1c9394a Fix fast-shutdown hang on ThreadImport+GenesisWait (Matt Corallo)
Pull request description:
The second commit is a much simpler alternative fix for the issue fixed in #12349. To test I made ShutdownRequested() always StartShutdown() after a certain number of calls, which turned up one other hang, fixed in the first commit.
Tree-SHA512: 86bde6ac4b8b4e2cb99fff87dafeed02c0d9514acee6d94455637fb2da9ffc274b5ad31b0a6b9f5bd7b700ae35395f28ddb14ffc65ddda3619aa28df28a5607d
Backport of Core PR 12367
https://github.com/bitcoin/bitcoin/pull/12367/files
Completes T624
Depends on T625
Test Plan:
make check
Testing instructions in the original PR are not very clear. I manually tested early shutdown with various delays on bitcoind and observed no unexpected behavior.
Reviewers: deadalnix, Fabien, #bitcoin_abc
Reviewed By: Fabien, #bitcoin_abc
Differential Revision: https://reviews.bitcoinabc.org/D2906