@@ -1183,7 +1183,7 @@ void CheckForkWarningConditions()
1183
1183
1184
1184
if (pindexBestForkTip || (pindexBestInvalid && pindexBestInvalid->nChainWork > chainActive.Tip ()->nChainWork + (GetBlockProof (*chainActive.Tip ()) * 6 )))
1185
1185
{
1186
- if (!fLargeWorkForkFound && pindexBestForkBase)
1186
+ if (!GetfLargeWorkForkFound () && pindexBestForkBase)
1187
1187
{
1188
1188
std::string warning = std::string (" 'Warning: Large-work fork detected, forking after block " ) +
1189
1189
pindexBestForkBase->phashBlock ->ToString () + std::string (" '" );
@@ -1194,18 +1194,18 @@ void CheckForkWarningConditions()
1194
1194
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__,
1195
1195
pindexBestForkBase->nHeight , pindexBestForkBase->phashBlock ->ToString (),
1196
1196
pindexBestForkTip->nHeight , pindexBestForkTip->phashBlock ->ToString ());
1197
- fLargeWorkForkFound = true ;
1197
+ SetfLargeWorkForkFound ( true ) ;
1198
1198
}
1199
1199
else
1200
1200
{
1201
1201
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 ) ;
1203
1203
}
1204
1204
}
1205
1205
else
1206
1206
{
1207
- fLargeWorkForkFound = false ;
1208
- fLargeWorkInvalidChainFound = false ;
1207
+ SetfLargeWorkForkFound ( false ) ;
1208
+ SetfLargeWorkInvalidChainFound ( false ) ;
1209
1209
}
1210
1210
}
1211
1211
@@ -1481,7 +1481,7 @@ bool UndoReadFromDisk(CBlockUndo& blockundo, const CDiskBlockPos& pos, const uin
1481
1481
/* * Abort with a message */
1482
1482
bool AbortNode (const std::string& strMessage, const std::string& userMessage=" " )
1483
1483
{
1484
- strMiscWarning = strMessage;
1484
+ SetMiscWarning ( strMessage) ;
1485
1485
LogPrintf (" *** %s\n " , strMessage);
1486
1486
uiInterface.ThreadSafeMessageBox (
1487
1487
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) {
2050
2050
ThresholdState state = checker.GetStateFor (pindex, chainParams.GetConsensus (), warningcache[bit]);
2051
2051
if (state == THRESHOLD_ACTIVE || state == THRESHOLD_LOCKED_IN) {
2052
2052
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);
2054
2055
if (!fWarned ) {
2055
- AlertNotify (strMiscWarning );
2056
+ AlertNotify (strWarning );
2056
2057
fWarned = true ;
2057
2058
}
2058
2059
} else {
@@ -2072,10 +2073,11 @@ void static UpdateTip(CBlockIndex *pindexNew, const CChainParams& chainParams) {
2072
2073
warningMessages.push_back (strprintf (" %d of last 100 blocks have unexpected version" , nUpgraded));
2073
2074
if (nUpgraded > 100 /2 )
2074
2075
{
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);
2077
2079
if (!fWarned ) {
2078
- AlertNotify (strMiscWarning );
2080
+ AlertNotify (strWarning );
2079
2081
fWarned = true ;
2080
2082
}
2081
2083
}
0 commit comments