Skip to content
This repository has been archived by the owner on Apr 8, 2023. It is now read-only.

Commit

Permalink
Provide a fix for issue #5
Browse files Browse the repository at this point in the history
  • Loading branch information
jfm-so committed Apr 15, 2016
1 parent bf8065a commit accf082
Show file tree
Hide file tree
Showing 3 changed files with 6 additions and 4 deletions.
4 changes: 2 additions & 2 deletions api.php
Expand Up @@ -15,8 +15,8 @@
$twofactoren = $row['authused'];
$isadmin = $row['admin'];
$client = new Client($rpc_host, $rpc_port, $rpc_user, $rpc_pass);
$apibal = $client->getBalance($username);
$addr = $client->getAddress($username);;
$apibal = $client->getBalance($username) - $fee;
$addr = $client->getAddress($username);
}
if ($isadmin == 1) {
$ifadmin = "true";
Expand Down
2 changes: 2 additions & 0 deletions common.php
Expand Up @@ -35,4 +35,6 @@ function satoshitrim($satoshitrim) {
$support = "support@yourwebsite.com"; //Your support eMail
$hide_ids = array(1); //Hide account from admin dashboard
$donation_address = "13jy6rHB7HMgQBoYxQQXSM7TFTZZ6CDAAZ"; //Donation Address

$fee = "0.001"; //Set a fee to prevent negitive balances
?>
4 changes: 2 additions & 2 deletions index.php
Expand Up @@ -19,15 +19,15 @@
$admin_action = $_GET['a'];
}
if (!$admin_action) {
$balance = $client->getBalance($user_session);
$balance = $client->getBalance($user_session) - $fee;
if (!empty($_POST['jsaction'])) {
$json = array();
switch ($_POST['jsaction']) {
case "new_address":
$client->getnewaddress($user_session);
$json['success'] = true;
$json['message'] = "A new address was added to your wallet";
$json['balance'] = $client->getBalance($user_session);
$json['balance'] = $client->getBalance($user_session) - $fee;
$json['addressList'] = $client->getAddressList($user_session);
$json['transactionList'] = $client->getTransactionList($user_session);
echo json_encode($json); exit;
Expand Down

0 comments on commit accf082

Please sign in to comment.