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