} //checks secret key //echo "real_secret=$real_secret - bc secret=".BLOCKCHAIN_SECRET."<br>"; //COINCAFE_API_SECRET //if($real_secret!=BLOCKCHAIN_SECRET){ echo "secretmismatch $real_secret"; die; } //verify that the transaction is real ... call our bitcoind for LIVE only $strValidTransaction = funct_Billing_ValidateTransactionHash($transaction_hash); if ($strValidTransaction != "good") { echo "transactionnotinbitcoind"; die; } //transaction is not valid //this is only for our own bitcoind server on amsterdam if ($confirmations or $strServer) { //verify that the address is real and ( exists on our bitcoind server Live Only ) $strValidAddress = funct_Billing_ValidateAddress($input_address); if ($strValidAddress == "bad") { echo "badaddress"; die; } //address is not valid if ($strValidAddress != "mine") { echo "addressnotinbitcoind"; die; } //address is not owned by our bitcoind } /* */ //#################################################################### //search order table for transaction hash to avoid duplicates! //** now duplicates are ok.. we can just update the confirmations count...
$intTime = time(); $strIPAddress = $_SERVER['REMOTE_ADDR']; if (!$strWalletHash) { $strError_send = "No wallet address specified."; } //check if they are sending to an email address if (funct_check_email_address($strWalletHash)) { $strSendToEmailAddress = $strWalletHash; } else { //bitcoind address so remove all non alpha numeric characters if (!preg_match("/[a-z0-9]/i", $strWalletHash)) { // non alpha numeric characters passed $strError_send = $strError_send . " No html allowed in address. Please paste text only. Do not paste address directly from a browser link."; } else { //check the address via bitcoind validate 1=yes noconnect means that the bitcoind was not reachable $strIsValidAddress = funct_Billing_ValidateAddress($strWalletHash); if ($strIsValidAddress == "bad") { $strError_send = $strError_send . " Not a Valid Bitcoin Address (error= {$strIsValidAddress})"; } } } //remove all non alpha numeric $strWalletHash = functRemoveNonAlphaNumeric($strWalletHash); //fend of neg attack $intBTCamt = abs($intBTCamt); $intUSDamt = abs($intUSDamt); //calculate btc value to send based on exchange price $strCrypto = "btc"; $strExchange = RATE_HUD_EXCHANGE; $intRate = funct_Billing_GetRate($strCrypto, $strExchange); $intUSDamt = $intBTCamt * $intRate;