[UPDATE] Also detect testnet on RPC > 0.16
This commit is contained in:
parent
d1d4a07609
commit
e79b558163
@ -30,6 +30,15 @@ class BitcoinWrapper extends BitcoinClient {
|
|||||||
return $this->memcache->setCache(__FUNCTION__, parent::getnetworkinfo()+parent::getmininginfo()+parent::getwalletinfo(), 30);
|
return $this->memcache->setCache(__FUNCTION__, parent::getnetworkinfo()+parent::getmininginfo()+parent::getwalletinfo(), 30);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
public function is_testnet() {
|
||||||
|
$this->oDebug->append("STA " . __METHOD__, 4);
|
||||||
|
if ($data = $this->memcache->get(__FUNCTION__)) return $data;
|
||||||
|
if (!(parent::getblockchaininfo()))
|
||||||
|
return $this->memcache->setCache(__FUNCTION__, parent::is_testnet(), 30);
|
||||||
|
else
|
||||||
|
return $this->memcache->setCache(__FUNCTION__, parent::getblockchaininfo()['chain'] == 'test', 30);
|
||||||
|
}
|
||||||
|
|
||||||
public function getmininginfo() {
|
public function getmininginfo() {
|
||||||
$this->oDebug->append("STA " . __METHOD__, 4);
|
$this->oDebug->append("STA " . __METHOD__, 4);
|
||||||
if ($data = $this->memcache->get(__FUNCTION__)) return $data;
|
if ($data = $this->memcache->get(__FUNCTION__)) return $data;
|
||||||
|
|||||||
Loading…
Reference in New Issue
Block a user