Make GetBlockHash() calculate the blockhash if phashBlock is null
This commit is contained in:
@@ -513,8 +513,11 @@ public:
|
||||
uint256 GetBlockHash() const
|
||||
{
|
||||
if(phashBlock == NULL) {
|
||||
fprintf(stderr, "GetBlockHash: phashBlock NULL at height %d\n", this->GetHeight());
|
||||
assert(phashBlock);
|
||||
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() );
|
||||
// assert(phashBlock);
|
||||
return blockhash;
|
||||
}
|
||||
return *phashBlock;
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user