mirror of
https://github.com/dashpay/dash.git
synced 2024-12-25 12:02:48 +01:00
Bail out from GetBlockTxOuts in case nBlockHeight is above tip+1 (#2523)
In the future, we should make sure that this method is only called for the currently mined block or for old blocks, but never for non-existing blocks further in the future.
This commit is contained in:
parent
3a6bd8d235
commit
7037f7c999
@ -595,6 +595,13 @@ bool CMasternodePayments::GetBlockTxOuts(int nBlockHeight, CAmount blockReward,
|
||||
uint256 blockHash;
|
||||
{
|
||||
LOCK(cs_main);
|
||||
if (nBlockHeight - 1 > chainActive.Height()) {
|
||||
// there are some cases (e.g. IsScheduled) where legacy/compatibility code runs into this method with
|
||||
// block heights above the chain tip. Return false in this case
|
||||
// TODO remove this when removing the compatibility code and make sure this method is only called with
|
||||
// correct block height
|
||||
return false;
|
||||
}
|
||||
blockHash = chainActive[nBlockHeight - 1]->GetBlockHash();
|
||||
}
|
||||
uint256 proTxHash;
|
||||
|
Loading…
Reference in New Issue
Block a user