@ -1666,7 +1666,7 @@ bool UndoReadFromDisk(CBlockUndo& blockundo, const CBlockIndex* pindex)
// TODO: AbortNode() should take bilingual_str userMessage parameter.
static bool AbortNode ( const std : : string & strMessage , const std : : string & userMessage = " " , unsigned int prefix = 0 )
{
SetMiscWarning ( strMessage) ;
SetMiscWarning ( Untranslated( strMessage) ) ;
LogPrintf ( " *** %s \n " , strMessage ) ;
if ( ! userMessage . empty ( ) ) {
uiInterface . ThreadSafeMessageBox ( Untranslated ( userMessage ) , " " , CClientUIInterface : : MSG_ERROR | prefix ) ;
@ -2429,20 +2429,20 @@ void CChainState::PruneAndFlush() {
}
}
static void DoWarning ( const std: : string & strW arning)
static void DoWarning ( const bilingual_str& w arning)
{
static bool fWarned = false ;
SetMiscWarning ( strW arning) ;
SetMiscWarning ( w arning) ;
if ( ! fWarned ) {
AlertNotify ( strWarning ) ;
AlertNotify ( warning. original ) ;
fWarned = true ;
}
}
/** Private helper function that concatenates warning messages. */
static void AppendWarning ( std: : string & res , const std : : string & warn )
static void AppendWarning ( bilingual_str& res , const bilingual_str & warn )
{
if ( ! res . empty ( ) ) res + = " , " ;
if ( ! res . empty ( ) ) res + = Untranslated ( " , " ) ;
res + = warn ;
}
@ -2459,7 +2459,7 @@ void static UpdateTip(const CBlockIndex* pindexNew, const CChainParams& chainPar
g_best_block_cv . notify_all ( ) ;
}
std: : string warningM essages;
bilingual_str warning_m essages;
if ( ! : : ChainstateActive ( ) . IsInitialBlockDownload ( ) )
{
int nUpgraded = 0 ;
@ -2468,11 +2468,11 @@ void static UpdateTip(const CBlockIndex* pindexNew, const CChainParams& chainPar
WarningBitsConditionChecker checker ( bit ) ;
ThresholdState state = checker . GetStateFor ( pindex , chainParams . GetConsensus ( ) , warningcache [ bit ] ) ;
if ( state = = ThresholdState : : ACTIVE | | state = = ThresholdState : : LOCKED_IN ) {
const std: : string strW arning = strprintf ( _ ( " Warning: unknown new rules activated (versionbit %i) " ) . translated , bit ) ;
const bilingual_str w arning = strprintf ( _ ( " Warning: unknown new rules activated (versionbit %i) " ) , bit ) ;
if ( state = = ThresholdState : : ACTIVE ) {
DoWarning ( strW arning) ;
DoWarning ( w arning) ;
} else {
AppendWarning ( warning Messages, strW arning) ;
AppendWarning ( warning _messages, w arning) ;
}
}
}
@ -2485,14 +2485,14 @@ void static UpdateTip(const CBlockIndex* pindexNew, const CChainParams& chainPar
pindex = pindex - > pprev ;
}
if ( nUpgraded > 0 )
AppendWarning ( warning M essages, strprintf ( _ ( " %d of last 100 blocks have unexpected version " ) . translated , nUpgraded ) ) ;
AppendWarning ( warning _m essages, strprintf ( _ ( " %d of last 100 blocks have unexpected version " ) , nUpgraded ) ) ;
}
LogPrintf ( " %s: new best=%s height=%d version=0x%08x log2_work=%.8g tx=%lu date='%s' progress=%f cache=%.1fMiB(%utxo)%s \n " , __func__ ,
pindexNew - > GetBlockHash ( ) . ToString ( ) , pindexNew - > nHeight , pindexNew - > nVersion ,
log ( pindexNew - > nChainWork . getdouble ( ) ) / log ( 2.0 ) , ( unsigned long ) pindexNew - > nChainTx ,
FormatISO8601DateTime ( pindexNew - > GetBlockTime ( ) ) ,
GuessVerificationProgress ( chainParams . TxData ( ) , pindexNew ) , : : ChainstateActive ( ) . CoinsTip ( ) . DynamicMemoryUsage ( ) * ( 1.0 / ( 1 < < 20 ) ) , : : ChainstateActive ( ) . CoinsTip ( ) . GetCacheSize ( ) ,
! warning M essages. empty ( ) ? strprintf ( " warning='%s' " , warning Messages ) : " " ) ;
! warning _m essages. empty ( ) ? strprintf ( " warning='%s' " , warning _messages. original ) : " " ) ;
}