Fix implementation of GetBlockHash in CBlockIndex and CDiskBlockIndex
This commit is contained in:
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
|
||||
{
|
||||
|
||||
Reference in New Issue
Block a user