Skip to content

Commit

Permalink
fix NotifyBlockTip
Browse files Browse the repository at this point in the history
  • Loading branch information
CryptoForge committed Jun 23, 2023
1 parent 1006989 commit e24bccc
Showing 1 changed file with 6 additions and 10 deletions.
16 changes: 6 additions & 10 deletions src/main.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -4089,9 +4089,6 @@ bool static DisconnectTip(CValidationState &state, bool fBare = false) {
// Update cached incremental witnesses
GetMainSignals().ChainTip(pindexDelete, &block, newSproutTree, newSaplingTree, false);

//update UI of new tip
uiInterface.NotifyBlockTip(true, pindexDelete);

return true;
}

Expand Down Expand Up @@ -4315,9 +4312,6 @@ bool ConnectTip(CValidationState &state, CBlockIndex *pindexNew, CBlock *pblock)

EnforceNodeDeprecation(pindexNew->nHeight);

//Notify UI of new block
uiInterface.NotifyBlockTip(true, pindexNew);

int64_t nTime6 = GetTimeMicros(); nTimePostConnect += nTime6 - nTime5; nTimeTotal += nTime6 - nTime1;
LogPrint("bench", " - Connect postprocess: %.2fms [%.2fs]\n", (nTime6 - nTime5) * 0.001, nTimePostConnect * 0.000001);
LogPrint("bench", "- Connect block: %.2fms [%.2fs]\n", (nTime6 - nTime1) * 0.001, nTimeTotal * 0.000001);
Expand Down Expand Up @@ -4656,14 +4650,16 @@ bool ActivateBestChain(bool fSkipdpow, CValidationState &state, CBlock *pblock)
// Notify external listeners about the new tip.
GetMainSignals().UpdatedBlockTip(pindexNewTip);

//Notify UI
//Notify UI Startup screen
if (pindexNewTip->nHeight % 100 == 0)
{
uiInterface.InitMessage(_(("Activating best chain - Currently on block " + std::to_string(pindexNewTip->nHeight)).c_str()));
}
}

//Notify UI
uiInterface.NotifyBlockTip(fInitialDownload, pindexNewTip);

uiInterface.NotifyBlockTip(true, pindexNewTip);
} //else fprintf(stderr,"initial download skips propagation\n");
} while(pindexMostWork != pindexNewTip);
CheckBlockIndex();

Expand Down Expand Up @@ -5393,7 +5389,7 @@ bool ContextualCheckBlockHeader(const CBlockHeader& block, CValidationState& sta
{
return state.DoS(100, error("%s: rejected by checkpoint lock-in at %d", __func__, nHeight),REJECT_CHECKPOINT, "checkpoint mismatch");
}

// Don't accept any forks from the main chain prior to last checkpoint
CBlockIndex* pcheckpoint = Checkpoints::GetLastCheckpoint(chainParams.Checkpoints());
int32_t notarized_height;
Expand Down

0 comments on commit e24bccc

Please sign in to comment.