@ -787,23 +787,24 @@ public class Controller extends Thread {
String actionText ;
String actionText ;
// Use a more tolerant latest block timestamp in the isUpToDate() calls below to reduce misleading statuses.
// Use a more tolerant latest block timestamp in the isUpToDate() calls below to reduce misleading statuses.
// Any block in the last 60 minutes is considered "up to date" for the purposes of displaying statuses.
// Any block in the last 2 hours is considered "up to date" for the purposes of displaying statuses.
final Long minLatestBlockTimestamp = NTP . getTime ( ) - ( 60 * 60 * 1000L ) ;
// This also aligns with the time interval required for continued online account submission.
final Long minLatestBlockTimestamp = NTP . getTime ( ) - ( 2 * 60 * 60 * 1000L ) ;
// Only show sync percent if it's less than 100, to avoid confusion
final Integer syncPercent = Synchronizer . getInstance ( ) . getSyncPercent ( ) ;
final boolean isSyncing = ( syncPercent ! = null & & syncPercent < 100 ) ;
synchronized ( Synchronizer . getInstance ( ) . syncLock ) {
synchronized ( Synchronizer . getInstance ( ) . syncLock ) {
if ( Settings . getInstance ( ) . isLite ( ) ) {
if ( Settings . getInstance ( ) . isLite ( ) ) {
actionText = Translator . INSTANCE . translate ( "SysTray" , "LITE_NODE" ) ;
actionText = Translator . INSTANCE . translate ( "SysTray" , "LITE_NODE" ) ;
SysTray . getInstance ( ) . setTrayIcon ( 4 ) ;
SysTray . getInstance ( ) . setTrayIcon ( 4 ) ;
}
}
else if ( this . isMintingPossible ) {
actionText = Translator . INSTANCE . translate ( "SysTray" , "MINTING_ENABLED" ) ;
SysTray . getInstance ( ) . setTrayIcon ( 2 ) ;
}
else if ( numberOfPeers < Settings . getInstance ( ) . getMinBlockchainPeers ( ) ) {
else if ( numberOfPeers < Settings . getInstance ( ) . getMinBlockchainPeers ( ) ) {
actionText = Translator . INSTANCE . translate ( "SysTray" , "CONNECTING" ) ;
actionText = Translator . INSTANCE . translate ( "SysTray" , "CONNECTING" ) ;
SysTray . getInstance ( ) . setTrayIcon ( 3 ) ;
SysTray . getInstance ( ) . setTrayIcon ( 3 ) ;
}
}
else if ( ! this . isUpToDate ( minLatestBlockTimestamp ) & & Synchronizer . getInstance ( ) . isSynchroniz ing ( ) ) {
else if ( ! this . isUpToDate ( minLatestBlockTimestamp ) & & isSyncing ) {
actionText = String . format ( "%s - %d%%" , Translator . INSTANCE . translate ( "SysTray" , "SYNCHRONIZING_BLOCKCHAIN" ) , Synchronizer . getInstance ( ) . getSyncPercent ( ) ) ;
actionText = String . format ( "%s - %d%%" , Translator . INSTANCE . translate ( "SysTray" , "SYNCHRONIZING_BLOCKCHAIN" ) , Synchronizer . getInstance ( ) . getSyncPercent ( ) ) ;
SysTray . getInstance ( ) . setTrayIcon ( 3 ) ;
SysTray . getInstance ( ) . setTrayIcon ( 3 ) ;
}
}
@ -811,6 +812,10 @@ public class Controller extends Thread {
actionText = String . format ( "%s" , Translator . INSTANCE . translate ( "SysTray" , "SYNCHRONIZING_BLOCKCHAIN" ) ) ;
actionText = String . format ( "%s" , Translator . INSTANCE . translate ( "SysTray" , "SYNCHRONIZING_BLOCKCHAIN" ) ) ;
SysTray . getInstance ( ) . setTrayIcon ( 3 ) ;
SysTray . getInstance ( ) . setTrayIcon ( 3 ) ;
}
}
else if ( OnlineAccountsManager . getInstance ( ) . hasOnlineAccounts ( ) ) {
actionText = Translator . INSTANCE . translate ( "SysTray" , "MINTING_ENABLED" ) ;
SysTray . getInstance ( ) . setTrayIcon ( 2 ) ;
}
else {
else {
actionText = Translator . INSTANCE . translate ( "SysTray" , "MINTING_DISABLED" ) ;
actionText = Translator . INSTANCE . translate ( "SysTray" , "MINTING_DISABLED" ) ;
SysTray . getInstance ( ) . setTrayIcon ( 4 ) ;
SysTray . getInstance ( ) . setTrayIcon ( 4 ) ;