Move CBitcoinAddress to base58.cpp

This commit is contained in:
Pieter Wuille 2017-08-22 23:46:51 -07:00 committed by Jack Grigg
parent b6be3e88bb
commit 56c43a36bf
No known key found for this signature in database
GPG Key ID: 665DBCD284F7DAFF
2 changed files with 26 additions and 26 deletions

View File

@ -206,6 +206,32 @@ int CBase58Data::CompareTo(const CBase58Data& b58) const
namespace namespace
{ {
/** base58-encoded Bitcoin addresses.
* Public-key-hash-addresses have version 0 (or 111 testnet).
* The data vector contains RIPEMD160(SHA256(pubkey)), where pubkey is the serialized public key.
* Script-hash-addresses have version 5 (or 196 testnet).
* The data vector contains RIPEMD160(SHA256(cscript)), where cscript is the serialized redemption script.
*/
class CBitcoinAddress : public CBase58Data {
public:
bool Set(const CKeyID &id);
bool Set(const CScriptID &id);
bool Set(const CTxDestination &dest);
bool IsValid() const;
bool IsValid(const CChainParams &params) const;
bool SetString(const char* pszSecret);
bool SetString(const std::string& strSecret);
CBitcoinAddress() {}
CBitcoinAddress(const CTxDestination &dest) { Set(dest); }
CBitcoinAddress(const std::string& strAddress) { SetString(strAddress); }
CBitcoinAddress(const char* pszAddress) { SetString(pszAddress); }
CTxDestination Get() const;
bool GetKeyID(CKeyID &keyID) const;
bool IsScript() const;
};
class CBitcoinAddressVisitor : public boost::static_visitor<bool> class CBitcoinAddressVisitor : public boost::static_visitor<bool>
{ {
private: private:

View File

@ -140,32 +140,6 @@ public:
CZCSpendingKey(const libzcash::SpendingKey& addr) { Set(addr); } CZCSpendingKey(const libzcash::SpendingKey& addr) { Set(addr); }
}; };
/** base58-encoded Bitcoin addresses.
* Public-key-hash-addresses have version 0 (or 111 testnet).
* The data vector contains RIPEMD160(SHA256(pubkey)), where pubkey is the serialized public key.
* Script-hash-addresses have version 5 (or 196 testnet).
* The data vector contains RIPEMD160(SHA256(cscript)), where cscript is the serialized redemption script.
*/
class CBitcoinAddress : public CBase58Data {
public:
bool Set(const CKeyID &id);
bool Set(const CScriptID &id);
bool Set(const CTxDestination &dest);
bool IsValid() const;
bool IsValid(const CChainParams &params) const;
bool SetString(const char* pszSecret);
bool SetString(const std::string& strSecret);
CBitcoinAddress() {}
CBitcoinAddress(const CTxDestination &dest) { Set(dest); }
CBitcoinAddress(const std::string& strAddress) { SetString(strAddress); }
CBitcoinAddress(const char* pszAddress) { SetString(pszAddress); }
CTxDestination Get() const;
bool GetKeyID(CKeyID &keyID) const;
bool IsScript() const;
};
/** /**
* A base58-encoded secret key * A base58-encoded secret key
*/ */