@@ -287,6 +287,19 @@ bool DiagnosticsDialog::VerifyCPIDHasRAC()
287
287
return (racValue >= 1 ) ? true : false ;
288
288
}
289
289
290
+ double VerifyETTSReasonable ()
291
+ {
292
+ // We are going to compute the ETTS with ignore_staking_status set to true
293
+ // and also use a 960 block diff as the input, which smooths out short
294
+ // term fluctuations. The standard 1-1/e confidence (mean) is used.
295
+
296
+ double diff = GetAverageDifficulty (960 );
297
+
298
+ double result = GetEstimatedTimetoStake (true , diff);
299
+
300
+ return result;
301
+ }
302
+
290
303
int DiagnosticsDialog::VerifyCountSeedNodes ()
291
304
{
292
305
LOCK (cs_vNodes);
@@ -320,7 +333,7 @@ void DiagnosticsDialog::on_testButton_clicked()
320
333
}
321
334
322
335
// This needs to be updated if there are more tests added.
323
- unsigned int number_of_tests = 10 ;
336
+ unsigned int number_of_tests = 11 ;
324
337
325
338
ResetOverallDiagnosticResult (number_of_tests);
326
339
DisplayOverallDiagnosticResult ();
@@ -543,6 +556,36 @@ void DiagnosticsDialog::on_testButton_clicked()
543
556
UpdateOverallDiagnosticResult (NA);
544
557
}
545
558
559
+ // verify reasonable ETTS
560
+ ui->checkETTSResultLabel ->setStyleSheet (" " );
561
+ ui->checkETTSResultLabel ->setText (tr (" Testing..." ));
562
+ UpdateTestStatus (" checkETTS" , pending);
563
+ double ETTS = VerifyETTSReasonable () / (24.0 * 60.0 * 60.0 );
564
+
565
+ if (ETTS > 90.0 )
566
+ {
567
+ ui->checkETTSResultLabel ->setText (tr (" Failed: ETTS = %1 > 90 days" ));
568
+ ui->checkETTSResultLabel ->setStyleSheet (" color:white;background-color:red" );
569
+ UpdateTestStatus (" checkETTS" , completed);
570
+ UpdateOverallDiagnosticResult (failed);
571
+ }
572
+ else if (ETTS > 45.0 && ETTS <= 90.0 )
573
+ {
574
+ ui->checkETTSResultLabel ->setText (tr (" Warning: 45 days < ETTS = %1 <= 90 days" ));
575
+ ui->checkETTSResultLabel ->setStyleSheet (" color:black;background-color:yellow" );
576
+ UpdateTestStatus (" checkETTS" , completed);
577
+ UpdateOverallDiagnosticResult (warning);
578
+ }
579
+ else
580
+ {
581
+ ui->checkETTSResultLabel ->setText (tr (" Passed: ETTS <= 45 days" ));
582
+ ui->checkETTSResultLabel ->setStyleSheet (" color:white;background-color:green" );
583
+ UpdateTestStatus (" checkETTS" , completed);
584
+ UpdateOverallDiagnosticResult (passed);
585
+ }
586
+
587
+
588
+
546
589
// client version
547
590
ui->checkClientVersionResultLabel ->setStyleSheet (" " );
548
591
ui->checkClientVersionResultLabel ->setText (tr (" Testing..." ));
0 commit comments