mirror of
https://github.com/dashpay/dash.git
synced 2024-12-29 13:59:06 +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 *BlockLastSolved = chainActive.Tip();
|
||||||
const CBlockIndex *BlockReading = 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;
|
int nBlocksAgo = 0;
|
||||||
if(nBlockHeight > 0) nBlocksAgo = (chainActive.Tip()->nHeight+1)-nBlockHeight;
|
if(nBlockHeight > 0) nBlocksAgo = (chainActive.Tip()->nHeight+1)-nBlockHeight;
|
||||||
|
Loading…
Reference in New Issue
Block a user