예제 #1
0
파일: api.php 프로젝트: rhartness/slc24
 $address = mysql_real_escape_string($_GET["a"], $db);
 if ($currency == "slc") {
     if (check_slc_address($address)) {
         $result = withdraw_slc($address);
         if ($result["type"] == "intern") {
             json_success(array("hash" => md5($result["to_user"] . "gFdj#432_pyq54")));
         } else {
             json_success(array("hash" => null));
         }
     } else {
         json_error("Invalid address.");
     }
 }
 if ($currency == "btc") {
     if (check_btc_address($address)) {
         $result = withdraw_btc($address);
         if ($result["type"] == "intern") {
             json_success(array("hash" => md5($result["to_user"] . "gFdj#432_pyq54")));
         } else {
             json_success(array("hash" => null));
         }
     } else {
         json_error("Invalid address.");
     }
 }
 if ($currency == "nmc") {
     if (check_nmc_address($address)) {
         $result = withdraw_nmc($address);
         if ($result["type"] == "intern") {
             json_success(array("hash" => md5($result["to_user"] . "gFdj#432_pyq54")));
         } else {
예제 #2
0
    if (count($errors) == 0 && $server_balance < $amountwithfee * 1.05 + 1) {
        $errors[] = "There's currently not enough Bitcoins on the Bitcoin24 servers to fulfill your withdrawal request. Don't worry, a Bitcoin24 admin has been informed and will resolve this for you. You will get an email as soon as the Bitcoins 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! Bitcoin balance exhausted ({$server_balance} left)!", "A user with the email address " . $_SESSION["user_email"] . " legitimately tried to withdraw {$amount} Bitcoins. There are still {$server_balance} Bitcoins on the server. The request was denied. Please resolve this and make sure to inform the user.", "*****@*****.**");
    }
    if (count($errors) == 0) {
        echo "{$amount} Bitcoins are being transferred to {$address}.<br />";
        $result = withdraw_btc($address);
        if ($result["type"] == "extern") {
            $itxid = add_transaction($_SESSION["user_id"], "out", "extern", $amountwithfee, "BTC", "withdrawal", 0, $staticfee);
            $tx = withdraw_btc($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, "BTC", "withdrawal", 0);
            $tx = withdraw_btc($address, $amount, "", $itxid);
            $udt_transaction_a = "UPDATE transaction SET info_id = '{$tx['txid']}' WHERE id = '{$itxid}'";
            mysql_query($udt_transaction_a);
            echo "<small>Transaction (intern): {$tx['txid']}</small>";
        }
    } else {
        foreach ($errors as $error) {
            echo "{$error}<br />";
        }
        ?>
<br />
The Bitcoins will be transferred immediately to the specified address and removed from your balance.<br /><br />
Current balance: <?php 
        echo nice_format($balance, false, 0, 8);
        ?>
 Bitcoins<br />