Example #1
0
                 // Replace old donating groups with the new one.
                 $mining_pools->del_group('donate');
                 $mining_pools->add_group('donate');
                 foreach ($donation_pools['donate'] as $uuid => $pool) {
                     $mining_pools->add_pool($pool['url'], $pool['user'], $pool['pass'], 'donate');
                 }
             }
         }
         $don_pools = $mining_pools->get_pools('donate');
         if (!empty($don_pools)) {
             // Reset mining time to 0 so we begin after donating again checking for 24 hours.
             $rig_config['mining_time'] = 0;
             $rig_config['mining_last'] = '';
             // Try to connect to default connection values.
             try {
                 $rig_config['switch_back_group'] = $mining_pools->get_current_active_pool_group($main->get_rpc($rig));
                 if (empty($rig_config['switch_back_group'])) {
                     $rig_config['switch_back_group'] = 'default';
                 }
                 $main->reload_config();
                 // Switch to donating pool group.
                 $main->switch_pool_group('donate', $rig);
             } catch (APIException $ex) {
             }
         }
     }
 } else {
     if (!empty($rig_config['switch_back_group'])) {
         // We are donating, count up the time.
         // Only count up the time if cgminer is donating.
         if ($is_cgminer_running) {