mirror of
https://github.com/BillyOutlast/Gazelle-Porn.git
synced 2026-07-01 06:41:50 -04:00
34 lines
961 B
PHP
34 lines
961 B
PHP
<?php
|
|
class BitcoinRpc {
|
|
public static function __callStatic($Method, $Args) {
|
|
if (CONFIG['BITCOIN_RPC_URL']) {
|
|
return false;
|
|
}
|
|
$MessageID = mt_rand();
|
|
$Params = json_encode(
|
|
array(
|
|
'method' => $Method,
|
|
'params' => $Args,
|
|
'id' => $MessageID
|
|
)
|
|
);
|
|
|
|
$Request = array(
|
|
'http' => array(
|
|
'method' => 'POST',
|
|
'header' => 'Content-type: application/json',
|
|
'content' => $Params
|
|
)
|
|
);
|
|
|
|
if (!$Response = file_get_contents(CONFIG['BITCOIN_RPC_URL'], false, stream_context_create($Request))) {
|
|
return false;
|
|
}
|
|
$Response = json_decode($Response);
|
|
if ($Response->id != $MessageID || !empty($Response->error) || empty($Response->result)) {
|
|
return false;
|
|
}
|
|
return $Response->result;
|
|
}
|
|
}
|