From 71aca7e0afb1ff651705265db7bac4cba0a10368 Mon Sep 17 00:00:00 2001 From: Sebastian Grewe Date: Wed, 12 Feb 2014 12:55:41 +0100 Subject: [PATCH] [UPDATE] Getbalance wrapper We need to wrap our getbalance call due to issues in the coind and payout systems in the RPC. Apparently it's having issues with multiple accounts setup in a single wallet. Sendmany can not properly use other accounts added to the wallet as the payout account. Hence we wrap our getbalance call in the RPC and only return the default account balance at all times. Since this is used for all payouts and for payments from blocks, there should be no issue. Those pools running multiple accounts in their wallet will have to move their coins into the default wallet! --- 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 ccab6b41..ebe1c470 100644 --- a/public/include/classes/bitcoinwrapper.class.php +++ b/public/include/classes/bitcoinwrapper.class.php @@ -31,6 +31,12 @@ class BitcoinWrapper extends BitcoinClient { if ($data = $this->memcache->get(__FUNCTION__)) return $data; return $this->memcache->setCache(__FUNCTION__, parent::getmininginfo(), 30); } + // Wrapper to check our wallet balance from the DEFAULT account only + public function getbalance() { + $this->oDebug->append("STA " . __METHOD__, 4); + $aAccounts = parent::listaccounts(); + return $aAccounts['']; + } public function getblockcount() { $this->oDebug->append("STA " . __METHOD__, 4); if ($data = $this->memcache->get(__FUNCTION__)) return $data;