Browse Source

Added lock debugging for mapBlockSeedHeight.

keva-gui
Just Wonder 5 years ago
parent
commit
ace637e88c
  1. 1
      src/bitcoin-tx.cpp
  2. 1
      src/primitives/block.cpp

1
src/bitcoin-tx.cpp

@ -34,6 +34,7 @@ static const int CONTINUE_EXECUTION=-1; @@ -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;
//

1
src/primitives/block.cpp

@ -21,6 +21,7 @@ static void cn_get_block_hash_by_height(uint64_t seed_height, char cnHash[32]) @@ -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;
}

Loading…
Cancel
Save