1919import android .support .v4 .app .NotificationCompat ;
2020import android .support .v4 .content .ContextCompat ;
2121import android .support .v4 .content .LocalBroadcastManager ;
22- import android .widget .Toast ;
23-
22+ import android .util .Log ;
2423import org .pivxj .core .Block ;
2524import org .pivxj .core .Coin ;
2625import org .pivxj .core .FilteredBlock ;
2726import org .pivxj .core .InsufficientMoneyException ;
2827import org .pivxj .core .Peer ;
2928import org .pivxj .core .Transaction ;
30- import org .pivxj .core .TransactionBroadcast ;
3129import org .pivxj .core .TransactionConfidence ;
3230import org .pivxj .core .listeners .AbstractPeerDataEventListener ;
3331import org .pivxj .core .listeners .PeerConnectedEventListener ;
4341
4442import java .io .File ;
4543import java .math .BigDecimal ;
44+ import java .text .SimpleDateFormat ;
4645import java .util .ArrayList ;
4746import java .util .EnumSet ;
4847import java .util .List ;
@@ -636,16 +635,15 @@ private void tryScheduleService() {
636635 boolean isSchedule = System .currentTimeMillis () < module .getConf ().getScheduledBLockchainService ();
637636
638637 if (!isSchedule ){
639- log .info ("scheduling service" );
640638 AlarmManager alarm = (AlarmManager )getSystemService (ALARM_SERVICE );
641- long scheduleTime = System .currentTimeMillis () + 1000 * 60 ;//(1000 * 60 * 60); // One hour from now
642-
639+ long scheduleTime = System .currentTimeMillis () + 1000 * 60 * 15 ;//(1000 * 60 * 60); // One hour from now
640+ log . info ( "scheduling service for " + new SimpleDateFormat ( "MMM dd, yyyy hh:mm a" ). format ( scheduleTime ));
643641 Intent intent = new Intent (this , PivxWalletService .class );
644642 intent .setAction (ACTION_SCHEDULE_SERVICE );
645643 alarm .set (
646644 // This alarm will wake up the device when System.currentTimeMillis()
647645 // equals the second argument value
648- alarm .RTC_WAKEUP ,
646+ AlarmManager .RTC_WAKEUP ,
649647 scheduleTime ,
650648 // PendingIntent.getService creates an Intent that will start a service
651649 // when it is called. The first argument is the Context that will be used
@@ -665,14 +663,14 @@ private void tryScheduleService() {
665663 private void tryScheduleServiceNow () {
666664 log .info ("scheduling service now" );
667665 AlarmManager alarm = (AlarmManager )getSystemService (ALARM_SERVICE );
668- long scheduleTime = System .currentTimeMillis () + 1000 * 60 * 2 ; // 2 minutes
666+ long scheduleTime = System .currentTimeMillis () + 1000 * 60 * 10 ; // 2 minutes
669667
670668 Intent intent = new Intent (this , PivxWalletService .class );
671669 intent .setAction (ACTION_SCHEDULE_SERVICE );
672670 alarm .set (
673671 // This alarm will wake up the device when System.currentTimeMillis()
674672 // equals the second argument value
675- alarm .RTC_WAKEUP ,
673+ AlarmManager .RTC_WAKEUP ,
676674 scheduleTime ,
677675 // PendingIntent.getService creates an Intent that will start a service
678676 // when it is called. The first argument is the Context that will be used
@@ -724,6 +722,7 @@ private void requestRateCoin(){
724722 */
725723 private void check () {
726724 log .info ("check" );
725+ Log .i ("PIVX_SERVICE" , "Running check, is checking: " + isChecking .get ());
727726 try {
728727 if (!isChecking .getAndSet (true )) {
729728
0 commit comments