From eec52b7e4aa4c10b64b29cb28616f28aa7958f3b Mon Sep 17 00:00:00 2001 From: Sebastian Grewe Date: Sat, 7 Dec 2013 13:32:57 +0100 Subject: [PATCH] [UPDATE] Cache RPC getinfo calls --- public/include/classes/bitcoinwrapper.class.php | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/public/include/classes/bitcoinwrapper.class.php b/public/include/classes/bitcoinwrapper.class.php index 2ce5056b..dc6102b6 100644 --- a/public/include/classes/bitcoinwrapper.class.php +++ b/public/include/classes/bitcoinwrapper.class.php @@ -22,6 +22,12 @@ class BitcoinWrapper extends BitcoinClient { /** * 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() { $this->oDebug->append("STA " . __METHOD__, 4); if ($data = $this->memcache->get(__FUNCTION__)) return $data;