Browse Source

Fix implementation of GetBlockHash in CBlockIndex and CDiskBlockIndex

pull/332/head
Duke 7 months ago
parent
commit
d99ab44bfb
  1. 13
      src/chain.h

13
src/chain.h

@ -512,13 +512,7 @@ public:
uint256 GetBlockHash() const
{
if(phashBlock == NULL) {
auto header = this->GetBlockHeader();
auto blockhash = header.GetHash();
fprintf(stderr, "GetBlockHash: phashBlock NULL at height %d, returning blockhash=%s instead\n", this->GetHeight(), blockhash.ToString().c_str() );
// assert(phashBlock);
return blockhash;
}
assert(phashBlock);
return *phashBlock;
}
@ -683,6 +677,11 @@ public:
}
}
uint256 GetBlockHash() const
{
return GetBlockHeader().GetHash();
}
//! Get the block header for this block index.
CBlockHeader GetBlockHeader() const
{

Loading…
Cancel
Save