Merge pull request #141 from TheSerapher/issue-139

Issue 139
This commit is contained in:
Sebastian Grewe 2013-06-07 11:10:56 -07:00
commit d20efb3caa

View File

@ -142,7 +142,9 @@ class Transaction {
(
SELECT sum(t.amount) AS credit
FROM $this->table AS t
LEFT JOIN " . $this->block->getTableName() . " AS b ON t.block_id = b.id
WHERE t.type = 'Credit'
AND b.confirmations >= " . $this->config['confirmations'] . "
) AS t1,
(
SELECT sum(t.amount) AS debit
@ -152,7 +154,9 @@ class Transaction {
(
SELECT sum(t.amount) AS other
FROM " . $this->table . " AS t
LEFT JOIN " . $this->block->getTableName() . " AS b ON t.block_id = b.id
WHERE t.type IN ('Donation','Fee')
AND b.confirmations >= " . $this->config['confirmations'] . "
) AS t3");
if ($this->checkStmt($stmt) && $stmt->execute() && $stmt->bind_result($dBalance) && $stmt->fetch())
return $dBalance;