Exemplo n.º 1
0
     }
     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 {
                 json_success(array("hash" => null));
             }
         } else {
             json_error("Invalid address.");
         }
     }
     json_error("Unknown currency.");
 }
 if (isset($query[1])) {
     // 2.2.1 Transfer to user
     $currency = $query[1];
     if (!in_array($currency, $currencies1)) {
Exemplo n.º 2
0
    if (count($errors) == 0 && $server_balance < $amountwithfee * 1.05 + 1) {
        $errors[] = "There's currently not enough Namecoins on the Namecoin24 servers to fulfill your withdrawal request. Don't worry, a Namecoin24 admin has been informed and will resolve this for you. You will get an email as soon as the Namecoins 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! Namecoin balance exhausted ({$server_balance} left)!", "A user with the email address " . $_SESSION["user_email"] . " legitimately tried to withdraw {$amount} Namecoins. There are still {$server_balance} Namecoins on the server. The request was denied. Please resolve this and make sure to inform the user.", "*****@*****.**");
    }
    if (count($errors) == 0) {
        echo "{$amount} Namecoins are being transferred to {$address}.<br />";
        $result = withdraw_nmc($address);
        if ($result["type"] == "extern") {
            $itxid = add_transaction($_SESSION["user_id"], "out", "extern", $amountwithfee, "NMC", "withdrawal", 0, $staticfee);
            $tx = withdraw_nmc($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, "NMC", "withdrawal", 0);
            $tx = withdraw_nmc($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 Namecoins 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);
        ?>
 Namecoins<br />