Example #1
0
     $hasta = number_format(round($balanceDisponible / $dividirEntre, 8), 2, '.', '');
     if ($hasta > $maxReward) {
         $hasta = $maxReward;
     }
     if ($hasta < $minReward + 0.1) {
         header("Location: ./?msg=dry");
         exit;
     }
     $aleatorio = GetRandomValue($minReward, $hasta);
     $cantidadEnviar = $aleatorio * $dividirEntre - $transactionFee;
     $destination = array("amount" => $cantidadEnviar, "address" => $wallet);
     $date = new DateTime();
     $timestampUnix = $date->getTimestamp() + 5;
     $peticion = array("destinations" => $destination, "payment_id" => $paymentID, "fee" => $transactionFee, "mixin" => 6, "unlock_time" => 0);
     //print_r($peticion);
     $transferencia = $bitcoin->transfer($peticion);
     if ($transferencia == "Bad address") {
         header("Location: ./?msg=wallet");
         exit;
     }
     if (array_key_exists("tx_hash", $transferencia)) {
         $query = "INSERT INTO `payouts` (`payout_amount`,`ip_address`,`payout_address`,`payment_id`,`timestamp`) VALUES ('{$cantidadEnviar}','{$direccionIP}','{$wallet}','{$paymentID}',NOW());";
         mysqli_query($link, $query);
         mysqli_close($link);
         header("Location: ./?msg=success&txid=" . $transferencia['tx_hash'] . "&amount=" . $aleatorio);
         exit;
     } else {
     }
 } else {
     header("Location: ./?msg=captcha");
     exit;