diff --git a/src/base58.h b/src/base58.h index 2849798..124100c 100644 --- a/src/base58.h +++ b/src/base58.h @@ -181,34 +181,4 @@ struct Destination { } }; -class CBitcoinAddress : public CBase58Data -{ -public: - bool Set(const CKeyID& id, const CChainParams::Base58Type addrType = CChainParams::PUBKEY_ADDRESS); - bool Set(const CScriptID& id); - bool Set(const CTxDestination& dest, const CChainParams::Base58Type addrType = CChainParams::PUBKEY_ADDRESS); - bool IsValid() const; - bool IsValid(const CChainParams& params) const; - - CBitcoinAddress() {} - CBitcoinAddress(const CTxDestination& dest, const CChainParams::Base58Type addrType = CChainParams::PUBKEY_ADDRESS) { Set(dest, addrType); } - CBitcoinAddress(const std::string& strAddress) { SetString(strAddress); } - CBitcoinAddress(const char* pszAddress) { SetString(pszAddress); } - - CTxDestination Get() const; - bool GetKeyID(CKeyID& keyID) const; - bool IsScript() const; - bool IsStakingAddress() const; - - - // Helpers - static const CBitcoinAddress newCSInstance(const CTxDestination& dest) { - return CBitcoinAddress(dest, CChainParams::STAKING_ADDRESS); - } - - static const CBitcoinAddress newInstance(const CTxDestination& dest) { - return CBitcoinAddress(dest, CChainParams::PUBKEY_ADDRESS); - } -}; - #endif // BITCOIN_BASE58_H diff --git a/src/txdb.cpp b/src/txdb.cpp index c24d366..905e8c6 100644 --- a/src/txdb.cpp +++ b/src/txdb.cpp @@ -144,12 +144,10 @@ bool CCoinsViewDB::GetStats(CCoinsStats& stats) const //print UTXO CKeyID keyId; if(out.GetKeyIDFromUTXO(keyId)) { - CBitcoinAddress addr; - CBitcoinAddress addr777; - addr.Set(keyId); - addr777.Set(keyId, CChainParams::JACKPOT_PUBKEY_ADDRESS); + std::string strAddr = EncodeDestination(keyId, CChainParams::PUBKEY_ADDRESS); + std::string strAddr777 = EncodeDestination(keyId, CChainParams::JACKPOT_PUBKEY_ADDRESS); - utxo << "utxo;" << keyId.GetHex() << ";" << addr.ToString() << ";" << addr777.ToString() << ";" << out.nValue << ";" << (CAmount)(out.nValue / 5.32) << std::endl; + utxo << "utxo;" << keyId.GetHex() << ";" << strAddr << ";" << strAddr777 << ";" << out.nValue << ";" << (CAmount)(out.nValue / 5.32) << std::endl; } } } diff --git a/src/wallet/rpcdump.cpp b/src/wallet/rpcdump.cpp index 848e223..eed443a 100644 --- a/src/wallet/rpcdump.cpp +++ b/src/wallet/rpcdump.cpp @@ -525,9 +525,9 @@ UniValue dumpwallet(const UniValue& params, bool fHelp) file << strprintf(" # addr=%s%s\n", strAddr, (metadata.HasKeyOrigin() ? " hdkeypath="+metadata.key_origin.pathToString() : "")); // 777 - std::string strAddr777 = CBitcoinAddress(keyid, (metadata.HasKeyOrigin() && IsStakingDerPath(metadata.key_origin) ? + std::string strAddr777 = EncodeDestination(keyid, (metadata.HasKeyOrigin() && IsStakingDerPath(metadata.key_origin) ? CChainParams::STAKING_ADDRESS : - CChainParams::JACKPOT_PUBKEY_ADDRESS)).ToString(); + CChainParams::JACKPOT_PUBKEY_ADDRESS)); file << strprintf("%s %s ", KeyIO::EncodeSecret777(key), strTime); if (pwalletMain->mapAddressBook.count(keyid)) {