[UPDATE] Cache RPC getinfo calls

This commit is contained in:
Sebastian Grewe 2013-12-07 13:32:57 +01:00
parent 4ded825326
commit eec52b7e4a

View File

@ -22,6 +22,12 @@ class BitcoinWrapper extends BitcoinClient {
/** /**
* Wrap variouns methods to add caching * Wrap variouns methods to add caching
**/ **/
// Caching this, used for each can_connect call
public function getinfo() {
$this->oDebug->append("STA " . __METHOD__, 4);
if ($data = $this->memcache->get(__FUNCTION__)) return $data;
return $this->memcache->setCache(__FUNCTION__, parent::getinfo(), 30);
}
public function getblockcount() { public function getblockcount() {
$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;