@@ -1205,7 +1205,7 @@ void CheckForkWarningConditions()
1205
1205
if (pindexBestForkTip && chainActive.Height () - pindexBestForkTip->nHeight >= 72 )
1206
1206
pindexBestForkTip = NULL ;
1207
1207
1208
- if (pindexBestForkTip || (pindexBestInvalid && pindexBestInvalid->nChainWork > chainActive.Tip ()->nChainWork + (chainActive.Tip ()-> GetBlockWork ( ) * 6 )))
1208
+ if (pindexBestForkTip || (pindexBestInvalid && pindexBestInvalid->nChainWork > chainActive.Tip ()->nChainWork + (GetBlockProof (* chainActive.Tip ()) * 6 )))
1209
1209
{
1210
1210
if (!fLargeWorkForkFound )
1211
1211
{
@@ -1256,7 +1256,7 @@ void CheckForkWarningConditionsOnNewFork(CBlockIndex* pindexNewForkTip)
1256
1256
// We define it this way because it allows us to only store the highest fork tip (+ base) which meets
1257
1257
// the 7-block condition and from this always have the most-likely-to-cause-warning fork
1258
1258
if (pfork && (!pindexBestForkTip || (pindexBestForkTip && pindexNewForkTip->nHeight > pindexBestForkTip->nHeight )) &&
1259
- pindexNewForkTip->nChainWork - pfork->nChainWork > (pfork-> GetBlockWork ( ) * 7 ) &&
1259
+ pindexNewForkTip->nChainWork - pfork->nChainWork > (GetBlockProof (*pfork ) * 7 ) &&
1260
1260
chainActive.Height () - pindexNewForkTip->nHeight < 72 )
1261
1261
{
1262
1262
pindexBestForkTip = pindexNewForkTip;
@@ -2095,7 +2095,7 @@ CBlockIndex* AddToBlockIndex(const CBlockHeader& block)
2095
2095
pindexNew->nHeight = pindexNew->pprev ->nHeight + 1 ;
2096
2096
pindexNew->BuildSkip ();
2097
2097
}
2098
- pindexNew->nChainWork = (pindexNew->pprev ? pindexNew->pprev ->nChainWork : 0 ) + pindexNew-> GetBlockWork ( );
2098
+ pindexNew->nChainWork = (pindexNew->pprev ? pindexNew->pprev ->nChainWork : 0 ) + GetBlockProof (*pindexNew );
2099
2099
pindexNew->RaiseValidity (BLOCK_VALID_TREE);
2100
2100
if (pindexBestHeader == NULL || pindexBestHeader->nChainWork < pindexNew->nChainWork )
2101
2101
pindexBestHeader = pindexNew;
@@ -2788,7 +2788,7 @@ bool static LoadBlockIndexDB()
2788
2788
BOOST_FOREACH (const PAIRTYPE (int , CBlockIndex*)& item, vSortedByHeight)
2789
2789
{
2790
2790
CBlockIndex* pindex = item.second ;
2791
- pindex->nChainWork = (pindex->pprev ? pindex->pprev ->nChainWork : 0 ) + pindex-> GetBlockWork ( );
2791
+ pindex->nChainWork = (pindex->pprev ? pindex->pprev ->nChainWork : 0 ) + GetBlockProof (*pindex );
2792
2792
if (pindex->nStatus & BLOCK_HAVE_DATA) {
2793
2793
if (pindex->pprev ) {
2794
2794
if (pindex->pprev ->nChainTx ) {
0 commit comments