From 2e8a4c00fa03f8efe2b59ef9f32e9683f1f6472e Mon Sep 17 00:00:00 2001 From: Braydon Fuller Date: Thu, 17 Mar 2016 16:40:16 -0400 Subject: [PATCH] rpc: add receieved to balance --- src/rpcmisc.cpp | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/src/rpcmisc.cpp b/src/rpcmisc.cpp index d4ad29e655..549e6c7a5b 100644 --- a/src/rpcmisc.cpp +++ b/src/rpcmisc.cpp @@ -463,13 +463,18 @@ UniValue getaddressbalance(const UniValue& params, bool fHelp) } CAmount balance = 0; + CAmount received = 0; for (std::vector >::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;