aboutsummaryrefslogtreecommitdiff
path: root/src/util.cpp
diff options
context:
space:
mode:
authorJannis Froese <[email protected]>2014-03-13 22:48:23 +0100
committerJannis Froese <[email protected]>2014-03-22 22:13:27 +0100
commit1bf59137bee8bbf4699af8010e1fc2b2f92cef4d (patch)
treeedbea1a084de777059586a89ccef236e74dd6d69 /src/util.cpp
parentbuild: fix explicit --disable-qt-dbus (diff)
downloaddiscoin-1bf59137bee8bbf4699af8010e1fc2b2f92cef4d.tar.xz
discoin-1bf59137bee8bbf4699af8010e1fc2b2f92cef4d.zip
Protocol changes for Dogecoin 1.5
ported over from Dogecoin and Litecoin (cherry picked from commit 8b09dad2d506fc5a6239863b1c0e33bf7e84da00)
Diffstat (limited to 'src/util.cpp')
-rw-r--r--src/util.cpp52
1 files changed, 47 insertions, 5 deletions
diff --git a/src/util.cpp b/src/util.cpp
index 36dfd8ab7..96619f8db 100644
--- a/src/util.cpp
+++ b/src/util.cpp
@@ -965,7 +965,7 @@ boost::filesystem::path GetDefaultDataDir()
// Unix: ~/.bitcoin
#ifdef WIN32
// Windows
- return GetSpecialFolderPath(CSIDL_APPDATA) / "Bitcoin";
+ return GetSpecialFolderPath(CSIDL_APPDATA) / "Inutoshi";
#else
fs::path pathRet;
char* pszHome = getenv("HOME");
@@ -977,10 +977,10 @@ boost::filesystem::path GetDefaultDataDir()
// Mac
pathRet /= "Library/Application Support";
fs::create_directory(pathRet);
- return pathRet / "Bitcoin";
+ return pathRet / "Inutoshi";
#else
// Unix
- return pathRet / ".bitcoin";
+ return pathRet / ".inutoshi";
#endif
#endif
}
@@ -1029,7 +1029,7 @@ void ClearDatadirCache()
boost::filesystem::path GetConfigFile()
{
- boost::filesystem::path pathConfigFile(GetArg("-conf", "bitcoin.conf"));
+ boost::filesystem::path pathConfigFile(GetArg("-conf", "inutoshi.conf"));
if (!pathConfigFile.is_complete()) pathConfigFile = GetDataDir(false) / pathConfigFile;
return pathConfigFile;
}
@@ -1062,7 +1062,7 @@ void ReadConfigFile(map<string, string>& mapSettingsRet,
boost::filesystem::path GetPidFile()
{
- boost::filesystem::path pathPidFile(GetArg("-pid", "bitcoind.pid"));
+ boost::filesystem::path pathPidFile(GetArg("-pid", "inutoshi.pid"));
if (!pathPidFile.is_complete()) pathPidFile = GetDataDir() / pathPidFile;
return pathPidFile;
}
@@ -1332,6 +1332,48 @@ void seed_insecure_rand(bool fDeterministic)
}
}
+static const long hextable[] =
+{
+ -1, -1, -1, -1, -1, -1, -1, -1, -1, -1,
+ -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, // 10-19
+ -1, -1, -1, -1, -1, -1, -1, -1, -1, -1,
+ -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, // 30-39
+ -1, -1, -1, -1, -1, -1, -1, -1, 0, 1,
+ 2, 3, 4, 5, 6, 7, 8, 9, -1, -1, // 50-59
+ -1, -1, -1, -1, -1, 10, 11, 12, 13, 14,
+ 15, -1, -1, -1, -1, -1, -1, -1, -1, -1, // 70-79
+ -1, -1, -1, -1, -1, -1, -1, -1, -1, -1,
+ -1, -1, -1, -1, -1, -1, -1, 10, 11, 12, // 90-99
+ 13, 14, 15, -1, -1, -1, -1, -1, -1, -1,
+ -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, // 110-109
+ -1, -1, -1, -1, -1, -1, -1, -1, -1, -1,
+ -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, // 130-139
+ -1, -1, -1, -1, -1, -1, -1, -1, -1, -1,
+ -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, // 150-159
+ -1, -1, -1, -1, -1, -1, -1, -1, -1, -1,
+ -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, // 170-179
+ -1, -1, -1, -1, -1, -1, -1, -1, -1, -1,
+ -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, // 190-199
+ -1, -1, -1, -1, -1, -1, -1, -1, -1, -1,
+ -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, // 210-219
+ -1, -1, -1, -1, -1, -1, -1, -1, -1, -1,
+ -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, // 230-239
+ -1, -1, -1, -1, -1, -1, -1, -1, -1, -1,
+ -1, -1, -1, -1, -1, -1
+};
+
+long hex2long(const char* hexString)
+{
+ long ret = 0;
+
+ while (*hexString && ret >= 0)
+ {
+ ret = (ret << 4) | hextable[(uint8_t)*hexString++];
+ }
+
+ return ret;
+}
+
string FormatVersion(int nVersion)
{
if (nVersion%100 == 0)