mirror of
https://github.com/dashpay/dash.git
synced 2024-12-28 05:23:01 +01:00
rpc: add receieved to balance
This commit is contained in:
parent
5bb6d69ff8
commit
2e8a4c00fa
@ -463,13 +463,18 @@ UniValue getaddressbalance(const UniValue& params, bool fHelp)
|
|||||||
}
|
}
|
||||||
|
|
||||||
CAmount balance = 0;
|
CAmount balance = 0;
|
||||||
|
CAmount received = 0;
|
||||||
|
|
||||||
for (std::vector<std::pair<CAddressIndexKey, CAmount> >::const_iterator it=addressIndex.begin(); it!=addressIndex.end(); it++) {
|
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;
|
balance += it->second;
|
||||||
}
|
}
|
||||||
|
|
||||||
UniValue result(UniValue::VOBJ);
|
UniValue result(UniValue::VOBJ);
|
||||||
result.push_back(Pair("balance", balance));
|
result.push_back(Pair("balance", balance));
|
||||||
|
result.push_back(Pair("received", received));
|
||||||
|
|
||||||
return result;
|
return result;
|
||||||
|
|
||||||
|
Loading…
Reference in New Issue
Block a user