Skip to content
Permalink
Browse files

Stealth addresses

  • Loading branch information...
Bushstar committed Dec 1, 2014
1 parent be5c45b commit 51221031e8aa4ec0b9bd25bab1508a7a71df2fd9
@@ -165,6 +165,7 @@ HEADERS += src/qt/bitcoingui.h \
src/db.h \
src/walletdb.h \
src/script.h \
src/stealth.h \
src/init.h \
src/bloom.h \
src/mruset.h \
@@ -301,7 +302,8 @@ SOURCES += src/qt/bitcoin.cpp \
src/shavite.c \
src/echo.c \
src/simd.c \
src/checkpointsync.cpp
src/checkpointsync.cpp \
src/stealth.cpp

RESOURCES += src/qt/bitcoin.qrc

@@ -264,6 +264,7 @@ class CBitcoinAddressVisitor : public boost::static_visitor<bool>
CBitcoinAddressVisitor(CBitcoinAddress *addrIn) : addr(addrIn) { }
bool operator()(const CKeyID &id) const;
bool operator()(const CScriptID &id) const;
bool operator()(const CStealthAddress &stxAddr) const;
bool operator()(const CNoDestination &no) const;
};

@@ -392,6 +393,7 @@ class CBitcoinAddress : public CBase58Data

bool inline CBitcoinAddressVisitor::operator()(const CKeyID &id) const { return addr->Set(id); }
bool inline CBitcoinAddressVisitor::operator()(const CScriptID &id) const { return addr->Set(id); }
bool inline CBitcoinAddressVisitor::operator()(const CStealthAddress &stxAddr) const { return false; }
bool inline CBitcoinAddressVisitor::operator()(const CNoDestination &id) const { return false; }

/** A base58-encoded secret key */
@@ -271,6 +271,13 @@ static const CRPCCommand vRPCCommands[] =
{ "lockunspent", &lockunspent, false, false, true },
{ "listlockunspent", &listlockunspent, false, false, true },
{ "verifychain", &verifychain, true, false, false },
{ "getnewstealthaddress", &getnewstealthaddress, false, false, true },
{ "liststealthaddresses", &liststealthaddresses, false, false, true },
{ "importstealthaddress", &importstealthaddress, false, false, true },
{ "sendtostealthaddress", &sendtostealthaddress, false, false, true },
{ "clearwallettransactions",&clearwallettransactions,false, false, true },
{ "scanforalltxns", &scanforalltxns, false, false, true },
{ "scanforstealthtxns", &scanforstealthtxns, false, false, true },
};

CRPCTable::CRPCTable()
@@ -1208,6 +1215,7 @@ Array RPCConvertValues(const std::string &strMethod, const std::vector<std::stri
if (strMethod == "sendalert" && n > 5) ConvertTo<boost::int64_t>(params[5]);
if (strMethod == "sendalert" && n > 6) ConvertTo<boost::int64_t>(params[6]);
if (strMethod == "enforcecheckpoint" && n > 0) ConvertTo<bool>(params[0]);
if (strMethod == "sendtostealthaddress" && n > 1) ConvertTo<double>(params[1]);

return params;
}
@@ -212,4 +212,12 @@ extern json_spirit::Value gettxoutsetinfo(const json_spirit::Array& params, bool
extern json_spirit::Value gettxout(const json_spirit::Array& params, bool fHelp);
extern json_spirit::Value verifychain(const json_spirit::Array& params, bool fHelp);

extern json_spirit::Value getnewstealthaddress(const json_spirit::Array& params, bool fHelp);
extern json_spirit::Value liststealthaddresses(const json_spirit::Array& params, bool fHelp);
extern json_spirit::Value importstealthaddress(const json_spirit::Array& params, bool fHelp);
extern json_spirit::Value sendtostealthaddress(const json_spirit::Array& params, bool fHelp);
extern json_spirit::Value clearwallettransactions(const json_spirit::Array& params, bool fHelp);
extern json_spirit::Value scanforalltxns(const json_spirit::Array& params, bool fHelp);
extern json_spirit::Value scanforstealthtxns(const json_spirit::Array& params, bool fHelp);

#endif
@@ -73,7 +73,7 @@ bool CCryptoKeyStore::SetCrypted()
return true;
}

bool CCryptoKeyStore::Lock()
bool CCryptoKeyStore::LockKeyStore()
{
if (!SetCrypted())
return false;
@@ -105,15 +105,14 @@ typedef std::map<CKeyID, std::pair<CPubKey, std::vector<unsigned char> > > Crypt
class CCryptoKeyStore : public CBasicKeyStore
{
private:
CryptedKeyMap mapCryptedKeys;

CKeyingMaterial vMasterKey;

// if fUseCrypto is true, mapKeys must be empty
// if fUseCrypto is false, vMasterKey must be empty
bool fUseCrypto;

protected:
CryptedKeyMap mapCryptedKeys;
CKeyingMaterial vMasterKey;

bool SetCrypted();

// will encrypt previously unencrypted keys
@@ -143,7 +142,7 @@ class CCryptoKeyStore : public CBasicKeyStore
return result;
}

bool Lock();
bool LockKeyStore();

virtual bool AddCryptedKey(const CPubKey &vchPubKey, const std::vector<unsigned char> &vchCryptedSecret);
bool AddKey(const CKey& key);

This file was deleted.

@@ -107,7 +107,8 @@ OBJS= \
obj/echo.o \
obj/shavite.o \
obj/simd.o \
obj/checkpointsync.o
obj/checkpointsync.o \
obj/stealth.o

all: deepcoind.exe

@@ -113,7 +113,8 @@ OBJS= \
obj/echo.o \
obj/shavite.o \
obj/simd.o \
obj/checkpointsync.o
obj/checkpointsync.o \
obj/stealth.o

ifndef USE_UPNP
override USE_UPNP = -
@@ -149,7 +149,8 @@ OBJS= \
obj/echo.o \
obj/shavite.o \
obj/simd.o \
obj/checkpointsync.o
obj/checkpointsync.o \
obj/stealth.o

all: deepcoind

0 comments on commit 5122103

Please sign in to comment.
You can’t perform that action at this time.