Skip to content

Commit 6a00e1a

Browse files
Rock-N-TrollRock-N-Troll
Rock-N-Troll
authored and
Rock-N-Troll
committed
display mining addresses in listaddresses rpc command
1 parent e55a309 commit 6a00e1a

File tree

1 file changed

+6
-2
lines changed

1 file changed

+6
-2
lines changed

src/wallet/rpcwallet.cpp

+6-2
Original file line numberDiff line numberDiff line change
@@ -732,7 +732,8 @@ static UniValue listaddresses(const JSONRPCRequest& request)
732732
{
733733
// Only get basecoin and stealth addresses
734734
if (!((item.first.type() == typeid(WitnessV0KeyHash)) ||
735-
(item.first.type() == typeid(CStealthAddress)))) continue;
735+
(item.first.type() == typeid(CStealthAddress)) ||
736+
(item.first.type() == typeid(CKeyID)))) continue;
736737
// Only get mine
737738
if (!pwallet->IsMine(item.first)) continue;
738739
// If we're balance only, require a balance
@@ -743,9 +744,12 @@ static UniValue listaddresses(const JSONRPCRequest& request)
743744
if (item.first.type() == typeid(CStealthAddress)) {
744745
entry.pushKV("address", EncodeDestination(item.first, true));
745746
entry.pushKV("amount", ValueFromAmount(AnonBalances[item.first]));
746-
} else {
747+
} else if (item.first.type() == typeid(WitnessV0KeyHash)) {
747748
entry.pushKV("address", EncodeDestination(item.first));
748749
entry.pushKV("amount", ValueFromAmount(balances[item.first]));
750+
} else {
751+
entry.pushKV("address", EncodeDestination(item.first, false));
752+
entry.pushKV("amount", ValueFromAmount(balances[item.first]));
749753
}
750754

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

0 commit comments

Comments
 (0)