Skip to content

Commit

Permalink
Fixed importprivkey to accept vanitygen privkeys too.
Browse files Browse the repository at this point in the history
We use Bitcoin privkey address (version byte = 128), while vanitygen uses version byte = 180.
Version 0.3.70.
  • Loading branch information
namecoin-qt committed Sep 6, 2013
1 parent c505340 commit 7531fc6
Show file tree
Hide file tree
Showing 4 changed files with 12 additions and 4 deletions.
2 changes: 1 addition & 1 deletion namecoin-qt.pro
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
TEMPLATE = app
TARGET = namecoin-qt
macx:TARGET = "Namecoin-Qt"
VERSION = 0.3.69
VERSION = 0.3.70
INCLUDEPATH += src src/json src/qt
QT += network
DEFINES += GUI QT_GUI BOOST_THREAD_USE_LIB BOOST_SPIRIT_THREADSAFE
Expand Down
10 changes: 9 additions & 1 deletion src/base58.h
Original file line number Diff line number Diff line change
Expand Up @@ -283,7 +283,15 @@ class CBitcoinSecret : public CBase58Data

bool SetString(const char* pszSecret)
{
return CBase58Data::SetString(pszSecret) && IsValid();
if (!CBase58Data::SetString(pszSecret))
return false;
// We use Bitcoin privkey format (nVersion = 128) as the default one,
// though also accept vanitygen addresses for importing, which
// use nVersion = address_version + 128 = 52 + 128 = 180.
if (nVersion == 180)
nVersion = 128;

return IsValid();
}

bool SetString(const std::string& strSecret)
Expand Down
2 changes: 1 addition & 1 deletion src/qt/res/bitcoin-qt.rc
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@ IDI_ICON1 ICON DISCARDABLE "icons/bitcoin.ico"

#define CLIENT_VERSION_MAJOR 0
#define CLIENT_VERSION_MINOR 3
#define CLIENT_VERSION_REVISION 69
#define CLIENT_VERSION_REVISION 70
#define CLIENT_VERSION_BUILD 0

// Converts the parameter X to a string after macro replacement on X has been performed.
Expand Down
2 changes: 1 addition & 1 deletion src/serialize.h
Original file line number Diff line number Diff line change
Expand Up @@ -35,7 +35,7 @@ class CDataStream;
class CAutoFile;
static const unsigned int MAX_SIZE = 0x02000000;

static const int VERSION = 36900;
static const int VERSION = 37000;
static const char* pszSubVer = "";
static const bool VERSION_IS_BETA = false;

Expand Down

0 comments on commit 7531fc6

Please sign in to comment.