Use balance_delta in txn list #731

Merged
hackrush01 merged 3 commits from txn_list into master 2017-11-22 18:14:16 +01:00
Showing only changes of commit 0052349ddc - Show all commits

View file

@ -21,8 +21,14 @@ export const selectTransactionItems = createSelector(
const tx = byId[txid];
//ignore dust/fees
if (Math.abs(tx.amount) === Math.abs(tx.fee)) {
return;
if (Math.abs(tx.value) === Math.abs(tx.fee)) {
// it is fee only txn if all infos are also empty
if (
tx.claim_info.length == 0 &&
tx.support_info.length == 0 &&
tx.update_info.length == 0
)
return;
}
let append = [];
@ -60,14 +66,14 @@ export const selectTransactionItems = createSelector(
//value on transaction, amount on outpoint
//amount is always positive, but should match sign of value
const amount = parseFloat(
item.amount ? (item.value < 0 ? -1 : 1) * item.amount : item.value
item.amount ? item.balance_delta : item.value
);
return {
txid: txid,
date: tx.timestamp ? new Date(parseInt(tx.timestamp) * 1000) : null,
amount: amount,
fee: amount < 0 ? -1 * tx.fee / append.length : 0,
fee: amount < 0 ? -1 * tx.fee : 0,
claim_id: item.claim_id,
claim_name: item.claim_name,
type: item.type || "send",