Skip to content

Commit 153499c

Browse files
committed
Retargets Fixed
1 parent eea78b9 commit 153499c

File tree

1 file changed

+2
-0
lines changed

1 file changed

+2
-0
lines changed

src/main.cpp

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1141,11 +1141,13 @@ unsigned int GetNextTargetRequired(const CBlockIndex* pindexLast, bool fProofOfS
11411141
/* The short averaging window */
11421142
const CBlockIndex *pindexShort = GetPrevBlockIndex(pindexPrev,
11431143
nIntervalShort, fProofOfStake);
1144+
if(!pindexShort) return(bnTargetLimit.GetCompact());
11441145
nActualTimespanShort = (int64)pindexPrev->nTime - (int64)pindexShort->nTime;
11451146

11461147
/* The long averaging window */
11471148
const CBlockIndex *pindexLong = GetPrevBlockIndex(pindexShort,
11481149
nIntervalLong - nIntervalShort, fProofOfStake);
1150+
if(!pindexLong) return(bnTargetLimit.GetCompact());
11491151
nActualTimespanLong = (int64)pindexPrev->nTime - (int64)pindexLong->nTime;
11501152

11511153
/* Time warp protection */

0 commit comments

Comments
 (0)