Skip to content

Commit

Permalink
Change list unspent method
Browse files Browse the repository at this point in the history
  • Loading branch information
ocruzv committed Jun 11, 2018
1 parent 699bea7 commit 9ca1293
Show file tree
Hide file tree
Showing 2 changed files with 9 additions and 23 deletions.
14 changes: 4 additions & 10 deletions src/renderer/components/LandingPage/FirstStep.vue
Original file line number Diff line number Diff line change
Expand Up @@ -60,17 +60,11 @@ export default {
client
.listUnspent()
.then((unspent) => {
const balance = unspent
let balance = 0;
unspent
.filter(tx => tx.spendable)
.reduce((prev, next) => {
let prevAmount = 0;
if (prev.amount) {
prevAmount = prev.amount;
} else {
prevAmount = prev;
}
const nextAmount = next.amount ? next.amount : 0;
return Number(prevAmount + nextAmount);
.forEach((tx) => {
balance += tx.amount;
});
this.$store.commit('SET_BALANCE', {
balance,
Expand Down
18 changes: 5 additions & 13 deletions yarn.lock
Original file line number Diff line number Diff line change
Expand Up @@ -1198,7 +1198,7 @@ [email protected]:
version "1.2.0"
resolved "https://registry.yarnpkg.com/base64-js/-/base64-js-1.2.0.tgz#a39992d723584811982be5e290bb6a53d86700f1"

base64-js@^1.0.2, base64-js@^1.2.3:
base64-js@^1.0.2:
version "1.3.0"
resolved "https://registry.yarnpkg.com/base64-js/-/base64-js-1.3.0.tgz#cab1e6118f051095e58b5281aea8c1cd22bfc0e3"

Expand Down Expand Up @@ -6374,14 +6374,6 @@ plist@^2.1.0:
xmlbuilder "8.2.2"
xmldom "0.1.x"

plist@^3.0.1:
version "3.0.1"
resolved "https://registry.yarnpkg.com/plist/-/plist-3.0.1.tgz#a9b931d17c304e8912ef0ba3bdd6182baf2e1f8c"
dependencies:
base64-js "^1.2.3"
xmlbuilder "^9.0.7"
xmldom "0.1.x"

pluralize@^7.0.0:
version "7.0.0"
resolved "https://registry.yarnpkg.com/pluralize/-/pluralize-7.0.0.tgz#298b89df8b93b0221dbf421ad2b1b1ea23fc6777"
Expand Down Expand Up @@ -8623,6 +8615,10 @@ window-size@^1.1.0:
define-property "^1.0.0"
is-number "^3.0.0"

winreg@^1.2.4:
version "1.2.4"
resolved "https://registry.yarnpkg.com/winreg/-/winreg-1.2.4.tgz#ba065629b7a925130e15779108cf540990e98d1b"

[email protected]:
version "0.0.2"
resolved "https://registry.yarnpkg.com/wordwrap/-/wordwrap-0.0.2.tgz#b79669bb42ecb409f83d583cad52ca17eaa1643f"
Expand Down Expand Up @@ -8683,10 +8679,6 @@ [email protected]:
version "8.2.2"
resolved "https://registry.yarnpkg.com/xmlbuilder/-/xmlbuilder-8.2.2.tgz#69248673410b4ba42e1a6136551d2922335aa773"

xmlbuilder@^9.0.7:
version "9.0.7"
resolved "https://registry.yarnpkg.com/xmlbuilder/-/xmlbuilder-9.0.7.tgz#132ee63d2ec5565c557e20f4c22df9aca686b10d"

[email protected]:
version "0.1.27"
resolved "https://registry.yarnpkg.com/xmldom/-/xmldom-0.1.27.tgz#d501f97b3bdb403af8ef9ecc20573187aadac0e9"
Expand Down

0 comments on commit 9ca1293

Please sign in to comment.