From a699b5b340ad9c1cbac7ea45b1cbf68c5fa2a865 Mon Sep 17 00:00:00 2001 From: pbca26 Date: Sun, 19 Nov 2017 19:11:32 +0300 Subject: [PATCH] addr list canspend flag --- routes/shepherd/dashboardUpdate.js | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/routes/shepherd/dashboardUpdate.js b/routes/shepherd/dashboardUpdate.js index 293bc2d..5361c8a 100644 --- a/routes/shepherd/dashboardUpdate.js +++ b/routes/shepherd/dashboardUpdate.js @@ -120,12 +120,15 @@ module.exports = (shepherd) => { let sum = 0; let spendableSum = 0; + let canspend = true; for (let i = 0; i < filteredArray.length; i++) { sum += filteredArray[i]; if (filteredArraySpends[i].spendable) { spendableSum += filteredArray[i]; + } else { + canspend = false; } } @@ -133,6 +136,7 @@ module.exports = (shepherd) => { address: result[a][b], amount: sum, spendable: spendableSum, + canspend, type: a === 0 ? 'public': 'private', }; }