mirror of
https://github.com/bitcoin/bitcoin.git
synced 2026-01-19 06:43:45 +01:00
Change CWallet addressgrouping to use CTxDestination instead of strings.
This is cleanup for the listaddressgroupings code. Also add some real help text.
This commit is contained in:
@@ -277,17 +277,21 @@ Value sendtoaddress(const Array& params, bool fHelp)
|
||||
Value listaddressgroupings(const Array& params, bool fHelp)
|
||||
{
|
||||
if (fHelp)
|
||||
throw runtime_error("listaddressgroupings");
|
||||
throw runtime_error(
|
||||
"listaddressgroupings\n"
|
||||
"Lists groups of addresses which have had their common ownership\n"
|
||||
"made public by common use as inputs or as the resulting change\n"
|
||||
"in past transactions");
|
||||
|
||||
Array jsonGroupings;
|
||||
map<string, int64> balances = pwalletMain->GetAddressBalances();
|
||||
BOOST_FOREACH(set<string> grouping, pwalletMain->GetAddressGroupings())
|
||||
map<CTxDestination, int64> balances = pwalletMain->GetAddressBalances();
|
||||
BOOST_FOREACH(set<CTxDestination> grouping, pwalletMain->GetAddressGroupings())
|
||||
{
|
||||
Array jsonGrouping;
|
||||
BOOST_FOREACH(string address, grouping)
|
||||
BOOST_FOREACH(CTxDestination address, grouping)
|
||||
{
|
||||
Array addressInfo;
|
||||
addressInfo.push_back(address);
|
||||
addressInfo.push_back(CBitcoinAddress(address).ToString());
|
||||
addressInfo.push_back(ValueFromAmount(balances[address]));
|
||||
{
|
||||
LOCK(pwalletMain->cs_wallet);
|
||||
|
||||
Reference in New Issue
Block a user