wallet: ignore spent blocks in listtransactions and fix order

unlike other wallets, a send operation generate 2 "transactions"
one for the send, and another with a bad time for the "spent" block
This commit is contained in:
Tanguy Pruvot 2016-02-16 06:04:32 +01:00
parent c28400a92e
commit 35e0ada99d

View file

@ -215,7 +215,11 @@ if (!empty($txs)) {
if (intval($tx['time']) > $list_since)
$txs_array[] = $tx;
}
krsort($txs_array);
if ($coin->symbol == 'DCR')
ksort($txs_array); // reversed order
else
krsort($txs_array);
}
$rows = 0;
@ -226,8 +230,14 @@ foreach($txs_array as $tx)
$block = $remote->getblock($tx['blockhash']);
$d = datetoa2($tx['time']);
$category = $tx['category'];
if ($coin->symbol == 'DCR') {
// ignore "spent" blocks...
if ($category == 'send' && arraySafeVal($tx,'generated'))
continue;
}
echo '<tr class="ssrow '.$category.'">';
echo '<td><b>'.$d.'</b></td>';