Exemple #1
0
 public static function CurrentPot()
 {
     if (Coin::force() || !file_exists('/tmp/aur_pot_date') || file_get_contents('/tmp/aur_pot_date') <= time()) {
         $timestamp = strtotime('+10 minutes', time());
         file_put_contents('/tmp/aur_pot_date', $timestamp);
         $address = Coin::where('code', 'BTC')->pluck('address');
         $pot = file_get_contents("http://blockexplorer.auroracoin.eu/chain/AuroraCoin/q/addressbalance/{$address}");
         Coin::where('code', 'AUR')->update(['pot' => $pot]);
     } else {
         $pot = Coin::where('code', 'AUR')->pluck('pot');
     }
     return round($pot, 8);
 }