Add missing locks required when accessing:
0int32_t nBlockSequenceId GUARDED_BY(cs_nBlockSequenceId) = 1;
1int nLastBlockFile GUARDED_BY(cs_LastBlockFile) = 0;
2bool fCheckForPruning GUARDED_BY(cs_LastBlockFile) = false;
3CuckooCache::cache<uint256, SignatureCacheHasher> scriptExecutionCache GUARDED_BY(cs_main);
4BlockMap& mapBlockIndex GUARDED_BY(cs_main);
5std::unique_ptr<CCoinsViewDB> pcoinsdbview GUARDED_BY(cs_main);
6std::unique_ptr<CCoinsViewCache> pcoinsTip GUARDED_BY(cs_main);
7std::unique_ptr<CBlockTreeDB> pblocktree GUARDED_BY(cs_main);
Also, add the locking annotations that follow from the requirements above.