Browse Source

implement getBlockHash method

main
ghost 3 years ago
parent
commit
704dc97951
  1. 31
      src/system/twister.php

31
src/system/twister.php

@ -46,4 +46,35 @@ class Twister { @@ -46,4 +46,35 @@ class Twister {
return false;
}
public function getBlockHash(int $number) {
$this->_curl->prepare(
'/',
'POST',
30,
[
'jsonrpc' => '2.0',
'method' => 'getblockhash',
'params' => [
$number
],
'id' => time() + rand()
]
);
if ($response = $this->_curl->execute()) {
if ($response['error']) {
$this->_error = _($response['error']['message']);
} else {
return $response['result'];
}
}
return false;
}
}
Loading…
Cancel
Save