aboutsummaryrefslogtreecommitdiffstats
path: root/app/scripts/lib/pending-balance-calculator.js
diff options
context:
space:
mode:
Diffstat (limited to 'app/scripts/lib/pending-balance-calculator.js')
-rw-r--r--app/scripts/lib/pending-balance-calculator.js8
1 files changed, 3 insertions, 5 deletions
diff --git a/app/scripts/lib/pending-balance-calculator.js b/app/scripts/lib/pending-balance-calculator.js
index c66bffbbb..cea642f1a 100644
--- a/app/scripts/lib/pending-balance-calculator.js
+++ b/app/scripts/lib/pending-balance-calculator.js
@@ -19,19 +19,17 @@ class PendingBalanceCalculator {
this.getPendingTransactions(),
])
- const balance = results[0]
- const pending = results[1]
-
+ const [ balance, pending ] = results
if (!balance) return undefined
const pendingValue = pending.reduce((total, tx) => {
- return total.add(this.valueFor(tx))
+ return total.add(this.calculateMaxCost(tx))
}, new BN(0))
return `0x${balance.sub(pendingValue).toString(16)}`
}
- valueFor (tx) {
+ calculateMaxCost (tx) {
const txValue = tx.txParams.value
const value = this.hexToBn(txValue)
const gasPrice = this.hexToBn(tx.txParams.gasPrice)