Skip to content

Commit

Permalink
minor fix
Browse files Browse the repository at this point in the history
  • Loading branch information
pedro-at-decenomy committed Jan 30, 2021
1 parent 6002b94 commit 3a2aac6
Show file tree
Hide file tree
Showing 3 changed files with 5 additions and 37 deletions.
30 changes: 0 additions & 30 deletions src/base58.h
Expand Up @@ -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
8 changes: 3 additions & 5 deletions src/txdb.cpp
Expand Up @@ -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;
}
}
}
Expand Down
4 changes: 2 additions & 2 deletions src/wallet/rpcdump.cpp
Expand Up @@ -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)) {
Expand Down

0 comments on commit 3a2aac6

Please sign in to comment.