@@ -1183,7 +1183,7 @@ void CheckForkWarningConditions()
11831183
11841184 if (pindexBestForkTip || (pindexBestInvalid && pindexBestInvalid->nChainWork > chainActive.Tip ()->nChainWork + (GetBlockProof (*chainActive.Tip ()) * 6 )))
11851185 {
1186- if (!fLargeWorkForkFound && pindexBestForkBase)
1186+ if (!GetfLargeWorkForkFound () && pindexBestForkBase)
11871187 {
11881188 std::string warning = std::string (" 'Warning: Large-work fork detected, forking after block " ) +
11891189 pindexBestForkBase->phashBlock ->ToString () + std::string (" '" );
@@ -1194,18 +1194,18 @@ void CheckForkWarningConditions()
11941194 LogPrintf (" %s: Warning: Large valid fork found\n forking the chain at height %d (%s)\n lasting to height %d (%s).\n Chain state database corruption likely.\n " , __func__,
11951195 pindexBestForkBase->nHeight , pindexBestForkBase->phashBlock ->ToString (),
11961196 pindexBestForkTip->nHeight , pindexBestForkTip->phashBlock ->ToString ());
1197- fLargeWorkForkFound = true ;
1197+ SetfLargeWorkForkFound ( true ) ;
11981198 }
11991199 else
12001200 {
12011201 LogPrintf (" %s: Warning: Found invalid chain at least ~6 blocks longer than our best chain.\n Chain state database corruption likely.\n " , __func__);
1202- fLargeWorkInvalidChainFound = true ;
1202+ SetfLargeWorkInvalidChainFound ( true ) ;
12031203 }
12041204 }
12051205 else
12061206 {
1207- fLargeWorkForkFound = false ;
1208- fLargeWorkInvalidChainFound = false ;
1207+ SetfLargeWorkForkFound ( false ) ;
1208+ SetfLargeWorkInvalidChainFound ( false ) ;
12091209 }
12101210}
12111211
@@ -1481,7 +1481,7 @@ bool UndoReadFromDisk(CBlockUndo& blockundo, const CDiskBlockPos& pos, const uin
14811481/* * Abort with a message */
14821482bool AbortNode (const std::string& strMessage, const std::string& userMessage=" " )
14831483{
1484- strMiscWarning = strMessage;
1484+ SetMiscWarning ( strMessage) ;
14851485 LogPrintf (" *** %s\n " , strMessage);
14861486 uiInterface.ThreadSafeMessageBox (
14871487 userMessage.empty () ? _ (" Error: A fatal internal error occurred, see debug.log for details" ) : userMessage,
@@ -2050,9 +2050,10 @@ void static UpdateTip(CBlockIndex *pindexNew, const CChainParams& chainParams) {
20502050 ThresholdState state = checker.GetStateFor (pindex, chainParams.GetConsensus (), warningcache[bit]);
20512051 if (state == THRESHOLD_ACTIVE || state == THRESHOLD_LOCKED_IN) {
20522052 if (state == THRESHOLD_ACTIVE) {
2053- strMiscWarning = strprintf (_ (" Warning: unknown new rules activated (versionbit %i)" ), bit);
2053+ std::string strWarning = strprintf (_ (" Warning: unknown new rules activated (versionbit %i)" ), bit);
2054+ SetMiscWarning (strWarning);
20542055 if (!fWarned ) {
2055- AlertNotify (strMiscWarning );
2056+ AlertNotify (strWarning );
20562057 fWarned = true ;
20572058 }
20582059 } else {
@@ -2072,10 +2073,11 @@ void static UpdateTip(CBlockIndex *pindexNew, const CChainParams& chainParams) {
20722073 warningMessages.push_back (strprintf (" %d of last 100 blocks have unexpected version" , nUpgraded));
20732074 if (nUpgraded > 100 /2 )
20742075 {
2075- // strMiscWarning is read by GetWarnings(), called by Qt and the JSON-RPC code to warn the user:
2076- strMiscWarning = _ (" Warning: Unknown block versions being mined! It's possible unknown rules are in effect" );
2076+ std::string strWarning = _ (" Warning: Unknown block versions being mined! It's possible unknown rules are in effect" );
2077+ // notify GetWarnings(), called by Qt and the JSON-RPC code to warn the user:
2078+ SetMiscWarning (strWarning);
20772079 if (!fWarned ) {
2078- AlertNotify (strMiscWarning );
2080+ AlertNotify (strWarning );
20792081 fWarned = true ;
20802082 }
20812083 }
0 commit comments