Browse Source

Fixed lock during block downloading.

keva-gui
Just Wonder 5 years ago
parent
commit
290612e9db
  1. 5
      src/primitives/block.cpp

5
src/primitives/block.cpp

@ -21,8 +21,9 @@ static void cn_get_block_hash_by_height(uint64_t seed_height, char cnHash[32]) @@ -21,8 +21,9 @@ 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.
// This will happen during initial block downloading, or when we
// are out of sync by more than at least SEEDHASH_EPOCH_BLOCKS blocks.
LOCK(cs_main);
pblockindex = mapBlockSeedHeight.find(seed_height)->second;
}
if (pblockindex == NULL) {

Loading…
Cancel
Save