decred: missed one 0.8.x getbalance for tickets

This commit is contained in:
Tanguy Pruvot 2017-02-17 20:13:28 +01:00
parent 9f3d194fd7
commit 9d1630c40c

View file

@ -124,7 +124,13 @@ function BackendWatchMarkets($marketname=NULL)
if ($coin->rpcencoding == 'DCR') {
// hack to store the locked balance history as a "stake" market
$remote = new WalletRPC($coin);
$stake = (double) $remote->getbalance('*',0,'locked');
$stake = 0.; //(double) $remote->getbalance('*',0,'locked');
$balances = $remote->getbalance('*',0);
if (isset($balances["balances"])) {
foreach ($balances["balances"] as $accb) {
$stake += (double) arraySafeVal($accb, 'lockedbytickets', 0);
}
}
$info = $remote->getstakeinfo();
if (empty($remote->error) && isset($info['difficulty']))
dborun("UPDATE markets SET balance=0, ontrade=:stake, balancetime=:time,