Added lock debugging for mapBlockSeedHeight.

This commit is contained in:
Just Wonder 2020-03-25 19:11:32 -07:00
parent 103d76c0b5
commit ace637e88c
2 changed files with 2 additions and 0 deletions

View File

@ -34,6 +34,7 @@ static const int CONTINUE_EXECUTION=-1;
// To fix the chainActive not defined error.
CChain chainActive;
typedef std::map<uint64_t, CBlockIndex*> BlockSeedHeightMap;
CCriticalSection cs_main;
BlockSeedHeightMap mapBlockSeedHeight;
//

View File

@ -21,6 +21,7 @@ static void cn_get_block_hash_by_height(uint64_t seed_height, char cnHash[32])
{
CBlockIndex* pblockindex = chainActive[seed_height];
if (pblockindex == NULL) {
AssertLockHeld(cs_main);
// This will only happens during initial block download.
pblockindex = mapBlockSeedHeight.find(seed_height)->second;
}