Untitled


SUBMITTED BY: Guest

DATE: Jan. 17, 2013, 12:55 a.m.

FORMAT: Text only

SIZE: 1.3 kB

HITS: 1350

  1. please consider a donation to: 1DQNJWxVsbiVwTbxVwHXqnN5gfjs8VK2Kk
  2. function bitcoinPass($bitcoin){
  3. error_log(time()."UNLOCKING WALLET: ".$GLOBALS['WALLETPASS'], 0);
  4. for ($i=0;$i<30;$i++){
  5. try{
  6. $bitcoin->walletpassphrase($GLOBALS['WALLETPASS'],30);
  7. return true;
  8. $i=31;break 2;
  9. }catch(Exception $e){}
  10. sleep(1);
  11. }
  12. return false;
  13. }
  14. function bitcoinsendfrom($bitcoin,$address,$amount){
  15. $txid=null;
  16. for ($i=0;$i<30;$i++){
  17. try{
  18. $txid=$bitcoin->sendfrom("webclick",$address,round($amount,8),1,"action_id:");
  19. if ($txid!=null){
  20. return $txid;
  21. $i=31;break 2;
  22. }
  23. }catch(Exception $e){}
  24. sleep(1);
  25. }
  26. return $txid;
  27. }
  28. function bitcoinvalidate($bitcoin,$address){
  29. for ($i=0;$i<30;$i++){
  30. try{
  31. $result=$bitcoin->validateaddress($address);
  32. if($result['isvalid']==1)return true;
  33. }catch(Exception $e){}
  34. sleep(1);
  35. }
  36. return false;
  37. }
  38. function sendbitcoin ($address,$amount){
  39. try{
  40. $bitcoin = get_bitcoin();
  41. if(bitcoinvalidate($bitcoin,$address)){
  42. if(bitcoinPass($bitcoin)) return bitcoinsendfrom($bitcoin,$address,$amount);
  43. }
  44. }catch (Exception $e){ }
  45. return null;
  46. }

comments powered by Disqus