changeset 29634:388e58e8be25

rpc: add receieved to balance
author Braydon Fuller <courier@braydon.com>
date Thu, 17 Mar 2016 16:40:16 -0400
parents 07de3eedb80a
children c9a2af7a47b1
files src/rpcmisc.cpp
diffstat 1 files changed, 5 insertions(+), 0 deletions(-) [+]
line wrap: on
line diff
--- a/src/rpcmisc.cpp	Thu Mar 17 16:06:08 2016 -0400
+++ b/src/rpcmisc.cpp	Thu Mar 17 16:40:16 2016 -0400
@@ -463,13 +463,18 @@
     }
 
     CAmount balance = 0;
+    CAmount received = 0;
 
     for (std::vector<std::pair<CAddressIndexKey, CAmount> >::const_iterator it=addressIndex.begin(); it!=addressIndex.end(); it++) {
+        if (it->second > 0) {
+            received += it->second;
+        }
         balance += it->second;
     }
 
     UniValue result(UniValue::VOBJ);
     result.push_back(Pair("balance", balance));
+    result.push_back(Pair("received", received));
 
     return result;