diff --git a/src/rpc/misc.cpp b/src/rpc/misc.cpp --- a/src/rpc/misc.cpp +++ b/src/rpc/misc.cpp @@ -22,6 +22,7 @@ #include "wallet/wallet.h" #include "wallet/walletdb.h" #endif +#include "cashaddrenc.h" #include "warnings.h" #include @@ -234,8 +235,9 @@ LOCK(cs_main); #endif + const CChainParams ¶ms = config.GetChainParams(); CTxDestination dest = - DecodeDestination(request.params[0].get_str(), config.GetChainParams()); + DecodeDestination(request.params[0].get_str(), params); bool isValid = IsValidDestination(dest); UniValue ret(UniValue::VOBJ); @@ -243,6 +245,8 @@ if (isValid) { std::string currentAddress = EncodeDestination(dest); ret.pushKV("address", currentAddress); + ret.pushKV("address_cashaddr", EncodeCashAddr(dest, params)); + ret.pushKV("address_legacy", EncodeLegacyAddr(dest, params)); CScript scriptPubKey = GetScriptForDestination(dest); ret.pushKV("scriptPubKey",