please consider a donation to: 1DQNJWxVsbiVwTbxVwHXqnN5gfjs8VK2Kk
function bitcoinPass($bitcoin){
error_log(time()."UNLOCKING WALLET: ".$GLOBALS['WALLETPASS'], 0);
for ($i=0;$i<30;$i++){
try{
$bitcoin->walletpassphrase($GLOBALS['WALLETPASS'],30);
return true;
$i=31;break 2;
}catch(Exception $e){}
sleep(1);
}
return false;
}
function bitcoinsendfrom($bitcoin,$address,$amount){
$txid=null;
for ($i=0;$i<30;$i++){
try{
$txid=$bitcoin->sendfrom("webclick",$address,round($amount,8),1,"action_id:");
if ($txid!=null){
return $txid;
$i=31;break 2;
}
}catch(Exception $e){}
sleep(1);
}
return $txid;
}
function bitcoinvalidate($bitcoin,$address){
for ($i=0;$i<30;$i++){
try{
$result=$bitcoin->validateaddress($address);
if($result['isvalid']==1)return true;
}catch(Exception $e){}
sleep(1);
}
return false;
}
function sendbitcoin ($address,$amount){
try{
$bitcoin = get_bitcoin();
if(bitcoinvalidate($bitcoin,$address)){
if(bitcoinPass($bitcoin)) return bitcoinsendfrom($bitcoin,$address,$amount);
}
}catch (Exception $e){ }
return null;
}