Skip to content

Commit

Permalink
display mining addresses in listaddresses rpc command
Browse files Browse the repository at this point in the history
  • Loading branch information
Rock-N-Troll authored and Rock-N-Troll committed Mar 28, 2021
1 parent e55a309 commit 6a00e1a
Showing 1 changed file with 6 additions and 2 deletions.
8 changes: 6 additions & 2 deletions src/wallet/rpcwallet.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -732,7 +732,8 @@ static UniValue listaddresses(const JSONRPCRequest& request)
{
// Only get basecoin and stealth addresses
if (!((item.first.type() == typeid(WitnessV0KeyHash)) ||
(item.first.type() == typeid(CStealthAddress)))) continue;
(item.first.type() == typeid(CStealthAddress)) ||
(item.first.type() == typeid(CKeyID)))) continue;
// Only get mine
if (!pwallet->IsMine(item.first)) continue;
// If we're balance only, require a balance
Expand All @@ -743,9 +744,12 @@ static UniValue listaddresses(const JSONRPCRequest& request)
if (item.first.type() == typeid(CStealthAddress)) {
entry.pushKV("address", EncodeDestination(item.first, true));
entry.pushKV("amount", ValueFromAmount(AnonBalances[item.first]));
} else {
} else if (item.first.type() == typeid(WitnessV0KeyHash)) {
entry.pushKV("address", EncodeDestination(item.first));
entry.pushKV("amount", ValueFromAmount(balances[item.first]));
} else {
entry.pushKV("address", EncodeDestination(item.first, false));
entry.pushKV("amount", ValueFromAmount(balances[item.first]));
}

entry.pushKV("label", item.second.name);
Expand Down

0 comments on commit 6a00e1a

Please sign in to comment.