Eliminate mapBlockIndex risk of nulls across VRSC

This commit is contained in:
miketout
2018-10-14 11:59:13 -07:00
parent aeadfa0490
commit d565e7b73c
6 changed files with 31 additions and 23 deletions

View File

@@ -1432,7 +1432,8 @@ int32_t CWallet::VerusStakeTransaction(CBlock *pBlock, CMutableTransaction &txNe
if (!GetTransaction(stakeSource.GetHash(), stakeSource, srcBlock))
return 0;
if ((pSrcIndex = mapBlockIndex[srcBlock]) == 0)
BlockMap::const_iterator it = mapBlockIndex.find(srcBlock);
if (it == mapBlockIndex.end() || (pSrcIndex = it->second) == 0)
return 0;
// !! DISABLE THIS FOR RELEASE: THIS MAKES A CHEAT TRANSACTION FOR EVERY STAKE FOR TESTING