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

@@ -148,7 +148,8 @@ bool ValidateStakeTransaction(const CTransaction &stakeTx, CStakeParams &stakePa
CBlockIndex *pindex;
if (myGetTransaction(stakeTx.vin[0].prevout.hash, srcTx, blkHash))
{
if ((pindex = mapBlockIndex[blkHash]) != NULL)
BlockMap::const_iterator it = mapBlockIndex.find(blkHash);
if (it != mapBlockIndex.end() && (pindex = it->second) != NULL)
{
std::vector<std::vector<unsigned char>> vAddr = std::vector<std::vector<unsigned char>>();