mirror of
https://github.com/dashpay/dash.git
synced 2024-12-27 13:03:17 +01:00
add a couple sanity checks to GetLastValidBlockHash
This commit is contained in:
parent
1f828f45ec
commit
6b0c7f3c4f
@ -1323,7 +1323,8 @@ bool CDarkSendPool::GetLastValidBlockHash(uint256& hash, int mod, int nBlockHeig
|
||||
const CBlockIndex *BlockLastSolved = chainActive.Tip();
|
||||
const CBlockIndex *BlockReading = chainActive.Tip();
|
||||
|
||||
if (BlockLastSolved == NULL || BlockLastSolved->nHeight == 0) { return false; }
|
||||
if (chainActive.Tip() == NULL) return false;
|
||||
if (BlockLastSolved == NULL || BlockLastSolved->nHeight == 0 || (chainActive.Tip()->nHeight+1 < nBlockHeight) return false;
|
||||
|
||||
int nBlocksAgo = 0;
|
||||
if(nBlockHeight > 0) nBlocksAgo = (chainActive.Tip()->nHeight+1)-nBlockHeight;
|
||||
|
Loading…
Reference in New Issue
Block a user