Exemplo n.º 1
0
 if (!get_lock("global")) {
     die("Too many queries. Please try again later.");
 }
 $balance = get_balance($_SESSION["user_id"], "SLC");
 if (count($errors) == 0) {
     $result = withdraw_slc($address);
     if ($result["type"] == "extern") {
         $amountwithfee = floor(($amount + $staticfee) * 10000) / 10000;
     } else {
         $amountwithfee = floor($amount * 10000) / 10000;
     }
     if ($amountwithfee > floor($balance * 10000) / 10000) {
         $errors[] = "You don't have that much.";
     }
 }
 $server_balance = $solidcoin->sc_getbalance("main") / 10000;
 if (count($errors) == 0 && $server_balance < $amountwithfee * 1.05 + 1) {
     $errors[] = "There's currently not enough Solidcoins on the Solidcoin24 servers to fulfill your withdrawal request. Don't worry, a Solidcoin24 admin has been informed and will resolve this for you. You will get an email as soon as the Solidcoins are available. Sorry for the inconvenience, but remember that a big part of the amounts are stored in a seperate wallets for your own security.";
     send_mail("Emergency! Solidcoin balance exhausted ({$server_balance} left)!", "A user with the email address " . $_SESSION["user_email"] . " legitimately tried to withdraw {$amount} Solidcoins. There are still {$server_balance} Solidcoins on the server. The request was denied. Please resolve this and make sure to inform the user.", "*****@*****.**");
 }
 if (count($errors) == 0) {
     echo "{$amount} Solidcoins are being transferred to {$address}.<br />";
     $result = withdraw_slc($address);
     if ($result["type"] == "extern") {
         $itxid = add_transaction($_SESSION["user_id"], "out", "extern", $amountwithfee, "SLC", "withdrawal", 0, $staticfee);
         $tx = withdraw_slc($address, $amount, "", $itxid);
         $udt_transaction_a = "UPDATE transaction SET info_id = '{$tx['txid']}' WHERE id = '{$itxid}'";
         mysql_query($udt_transaction_a);
         echo "<small>Transaction (extern): " . crypte_transaction($tx["txid"]) . "</small>";
     } else {
         $itxid = add_transaction($_SESSION["user_id"], "out", "intern", $amountwithfee, "SLC", "withdrawal", 0);