Merge pull request #15 from casinocoin/issue-13

dynamic coin name
This commit is contained in:
ajochems
2016-04-07 09:38:50 +02:00
28 changed files with 180 additions and 171 deletions

View File

@@ -1,6 +1,5 @@
TEMPLATE = app
TARGET = casinocoin-qt
macx:TARGET = "CasinoCoin-Qt"
VERSION = 2.0.0.0
INCLUDEPATH += src src/json src/qt
QT += core gui network widgets qml quick
@@ -119,7 +118,7 @@ contains(USE_BUILD_INFO, 1) {
QMAKE_CXXFLAGS_WARN_ON = -fdiagnostics-show-option -Wall -Wextra -Wformat -Wformat-security -Wno-unused-parameter -Wno-strict-aliasing -Wstack-protector
QMAKE_CXXFLAGS_WARN_ON += -Wno-unused-local-typedefs
QMAKE_CXXFLAGS_WARN_ON += -Wno-unused-local-typedefs -Wno-maybe-uninitialized
##### Start Project Files #####

View File

@@ -1,6 +1,6 @@
<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE QtCreatorProject>
<!-- Written by QtCreator 3.5.0, 2015-12-01T22:30:06. -->
<!-- Written by QtCreator 3.5.0, 2016-04-06T14:37:15. -->
<qtcreator>
<data>
<variable>EnvironmentId</variable>
@@ -73,7 +73,7 @@
<value type="QString" key="ProjectExplorer.ProjectConfiguration.DisplayName"></value>
<value type="QString" key="ProjectExplorer.ProjectConfiguration.Id">QtProjectManager.QMakeBuildStep</value>
<value type="bool" key="QtProjectManager.QMakeBuildStep.LinkQmlDebuggingLibrary">false</value>
<value type="bool" key="QtProjectManager.QMakeBuildStep.LinkQmlDebuggingLibraryAuto">true</value>
<value type="bool" key="QtProjectManager.QMakeBuildStep.LinkQmlDebuggingLibraryAuto">false</value>
<value type="QString" key="QtProjectManager.QMakeBuildStep.QMakeArguments">USE_UPNP=0 USE_QRCODE=1 USE_IPV6=1</value>
<value type="bool" key="QtProjectManager.QMakeBuildStep.QMakeForced">false</value>
<value type="bool" key="QtProjectManager.QMakeBuildStep.SeparateDebugInfo">false</value>
@@ -120,7 +120,7 @@
<value type="bool" key="Qt4ProjectManager.Qt4BuildConfiguration.UseShadowBuild">true</value>
</valuemap>
<valuemap type="QVariantMap" key="ProjectExplorer.Target.BuildConfiguration.1">
<value type="QString" key="ProjectExplorer.BuildConfiguration.BuildDirectory">C:/Users/a.jochems/Documents/GitHub/casinocoin-GUI-2.0</value>
<value type="QString" key="ProjectExplorer.BuildConfiguration.BuildDirectory">C:/Users/a.jochems/Documents/GitHub/casinocoin-issue-13</value>
<valuemap type="QVariantMap" key="ProjectExplorer.BuildConfiguration.BuildStepList.0">
<valuemap type="QVariantMap" key="ProjectExplorer.BuildStepList.Step.0">
<value type="bool" key="ProjectExplorer.BuildStep.Enabled">true</value>
@@ -128,7 +128,7 @@
<value type="QString" key="ProjectExplorer.ProjectConfiguration.DisplayName"></value>
<value type="QString" key="ProjectExplorer.ProjectConfiguration.Id">QtProjectManager.QMakeBuildStep</value>
<value type="bool" key="QtProjectManager.QMakeBuildStep.LinkQmlDebuggingLibrary">false</value>
<value type="bool" key="QtProjectManager.QMakeBuildStep.LinkQmlDebuggingLibraryAuto">true</value>
<value type="bool" key="QtProjectManager.QMakeBuildStep.LinkQmlDebuggingLibraryAuto">false</value>
<value type="QString" key="QtProjectManager.QMakeBuildStep.QMakeArguments">USE_UPNP=0 USE_QRCODE=1 USE_IPV6=1</value>
<value type="bool" key="QtProjectManager.QMakeBuildStep.QMakeForced">false</value>
<value type="bool" key="QtProjectManager.QMakeBuildStep.SeparateDebugInfo">false</value>
@@ -227,8 +227,8 @@
<value type="int" key="PE.EnvironmentAspect.Base">2</value>
<valuelist type="QVariantList" key="PE.EnvironmentAspect.Changes"/>
<value type="QString" key="ProjectExplorer.ProjectConfiguration.DefaultDisplayName">casinocoin-qt-windows</value>
<value type="QString" key="ProjectExplorer.ProjectConfiguration.DisplayName"></value>
<value type="QString" key="ProjectExplorer.ProjectConfiguration.Id">Qt4ProjectManager.Qt4RunConfiguration:C:/Users/a.jochems/Documents/GitHub/casinocoin-GUI-2.0/casinocoin-qt-windows.pro</value>
<value type="QString" key="ProjectExplorer.ProjectConfiguration.DisplayName">casinocoin-qt-windows2</value>
<value type="QString" key="ProjectExplorer.ProjectConfiguration.Id">Qt4ProjectManager.Qt4RunConfiguration:C:/Users/a.jochems/Documents/GitHub/casinocoin-issue-13/casinocoin-qt-windows.pro</value>
<value type="QString" key="Qt4ProjectManager.Qt4RunConfiguration.CommandLineArguments"></value>
<value type="QString" key="Qt4ProjectManager.Qt4RunConfiguration.ProFile">casinocoin-qt-windows.pro</value>
<value type="bool" key="Qt4ProjectManager.Qt4RunConfiguration.UseDyldImageSuffix">false</value>

View File

@@ -51,8 +51,8 @@ std::string CUnsignedAlert::ToString() const
return strprintf(
"CAlert(\n"
" nVersion = %d\n"
" nRelayUntil = %"PRI64d"\n"
" nExpiration = %"PRI64d"\n"
" nRelayUntil = %" PRI64d "\n"
" nExpiration = %" PRI64d "\n"
" nID = %d\n"
" nCancel = %d\n"
" setCancel = %s\n"

View File

@@ -182,10 +182,10 @@ Value stop(const Array& params, bool fHelp)
if (fHelp || params.size() > 1)
throw runtime_error(
"stop\n"
"Stop CasinoCoin server.");
"Stop "+ COIN_NAME_DISPLAY + " server.");
// Shutdown will take long enough that the response should get back
StartShutdown();
return "CasinoCoin server stopping";
return ""+ COIN_NAME_DISPLAY + " server stopping";
}
@@ -299,7 +299,7 @@ string HTTPPost(const string& strMsg, const map<string,string>& mapRequestHeader
{
ostringstream s;
s << "POST / HTTP/1.1\r\n"
<< "User-Agent: casinocoin-json-rpc/" << FormatFullVersion() << "\r\n"
<< "User-Agent: "+ COIN_NAME + "-json-rpc/" << FormatFullVersion() << "\r\n"
<< "Host: 127.0.0.1\r\n"
<< "Content-Type: application/json\r\n"
<< "Content-Length: " << strMsg.size() << "\r\n"
@@ -330,7 +330,7 @@ static string HTTPReply(int nStatus, const string& strMsg, bool keepalive)
if (nStatus == HTTP_UNAUTHORIZED)
return strprintf("HTTP/1.0 401 Authorization Required\r\n"
"Date: %s\r\n"
"Server: casinocoin-json-rpc/%s\r\n"
"Server: "+ COIN_NAME + "-json-rpc/%s\r\n"
"WWW-Authenticate: Basic realm=\"jsonrpc\"\r\n"
"Content-Type: text/html\r\n"
"Content-Length: 296\r\n"
@@ -357,7 +357,7 @@ static string HTTPReply(int nStatus, const string& strMsg, bool keepalive)
"Connection: %s\r\n"
"Content-Length: %"PRIszu"\r\n"
"Content-Type: application/json\r\n"
"Server: casinocoin-json-rpc/%s\r\n"
"Server: "+ COIN_NAME + "-json-rpc/%s\r\n"
"\r\n"
"%s",
nStatus,
@@ -737,7 +737,7 @@ void StartRPCThreads()
{
unsigned char rand_pwd[32];
RAND_bytes(rand_pwd, 32);
string strWhatAmI = "To use casinocoind";
string strWhatAmI = "To use "+ COIN_NAME + "d";
if (mapArgs.count("-server"))
strWhatAmI = strprintf(_("To use the %s option"), "\"-server\"");
else if (mapArgs.count("-daemon"))
@@ -746,13 +746,13 @@ void StartRPCThreads()
_("%s, you must set a rpcpassword in the configuration file:\n"
"%s\n"
"It is recommended you use the following random password:\n"
"rpcuser=casinocoinrpc\n"
"rpcuser=")+ COIN_NAME + _("rpc\n"
"rpcpassword=%s\n"
"(you do not need to remember this password)\n"
"The username and password MUST NOT be the same.\n"
"If the file does not exist, create it with owner-readable-only file permissions.\n"
"It is also recommended to set alertnotify so you are notified of problems;\n"
"for example: alertnotify=echo %%s | mail -s \"CasinoCoin Alert\" admin@foo.com\n"),
"for example: alertnotify=echo %%s | mail -s \"")+ COIN_NAME_DISPLAY + _(" Alert\" admin@foo.com\n"),
strWhatAmI.c_str(),
GetConfigFile().string().c_str(),
EncodeBase58(&rand_pwd[0],&rand_pwd[0]+32).c_str()),

View File

@@ -12,7 +12,7 @@
#define NOMINMAX
#endif
#define FD_SETSIZE 1024 // max number of fds in fd_set
#include <winsock2.h>
#include <windows.h>
#include <mswsock.h>
#include <ws2tcpip.h>
#else

View File

@@ -456,7 +456,7 @@ void CDBEnv::Flush(bool fShutdown)
else
mi++;
}
printf("DBFlush(%s)%s ended %15"PRI64d"ms\n", fShutdown ? "true" : "false", fDbEnvInit ? "" : " db not started", GetTimeMillis() - nStart);
printf("DBFlush(%s)%s ended %15" PRI64d "ms\n", fShutdown ? "true" : "false", fDbEnvInit ? "" : " db not started", GetTimeMillis() - nStart);
if (fShutdown)
{
char** listp;

View File

@@ -10,6 +10,7 @@
#include "init.h"
#include "util.h"
#include "ui_interface.h"
#include "version.h"
#include <boost/filesystem.hpp>
#include <boost/filesystem/fstream.hpp>
@@ -78,7 +79,7 @@ volatile bool fRequestShutdown = false;
void StartShutdown()
{
boost::this_thread::sleep_for( boost::chrono::seconds( 1 ) );
boost::this_thread::sleep_for( boost::chrono::seconds( 1 ) );
fRequestShutdown = true;
}
bool ShutdownRequested()
@@ -180,12 +181,12 @@ bool AppInit(int argc, char* argv[])
if (mapArgs.count("-?") || mapArgs.count("--help"))
{
// First part of help message is specific to bitcoind / RPC client
std::string strUsage = _("CasinoCoin version") + " " + FormatFullVersion() + "\n\n" +
std::string strUsage = COIN_NAME_DISPLAY + " version" + " " + FormatFullVersion() + "\n\n" +
_("Usage:") + "\n" +
" casinocoind [options] " + "\n" +
" casinocoind [options] <command> [params] " + _("Send command to -server or casinocoind") + "\n" +
" casinocoind [options] help " + _("List commands") + "\n" +
" casinocoind [options] help <command> " + _("Get help for a command") + "\n";
" "+ COIN_NAME + "d [options] " + "\n" +
" "+ COIN_NAME + "d [options] <command> [params] " + "Send command to -server or "+ COIN_NAME + "d" + "\n" +
" "+ COIN_NAME + "d [options] help " + "List commands" + "\n" +
" "+ COIN_NAME + "d [options] help <command> " + "Get help for a command" + "\n";
strUsage += "\n" + HelpMessage();
@@ -195,7 +196,7 @@ bool AppInit(int argc, char* argv[])
// Command-line RPC
for (int i = 1; i < argc; i++)
if (!IsSwitchChar(argv[i][0]) && !boost::algorithm::istarts_with(argv[i], "casinocoin:"))
if (!IsSwitchChar(argv[i][0]) && !boost::algorithm::istarts_with(argv[i], (std::string("") + COIN_NAME + ":").c_str()))
fCommandLine = true;
if (fCommandLine)
@@ -298,8 +299,8 @@ std::string HelpMessage()
{
string strUsage = _("Options:") + "\n" +
" -? " + _("This help message") + "\n" +
" -conf=<file> " + _("Specify configuration file (default: casinocoin.conf)") + "\n" +
" -pid=<file> " + _("Specify pid file (default: casinocoind.pid)") + "\n" +
" -conf=<file> " + "Specify configuration file (default: "+ COIN_NAME + ".conf)" + "\n" +
" -pid=<file> " + "Specify pid file (default: "+ COIN_NAME + "d.pid)" + "\n" +
" -gen " + _("Generate coins (default: 0)") + "\n" +
" -datadir=<dir> " + _("Specify data directory") + "\n" +
" -dbcache=<n> " + _("Set database cache size in megabytes (default: 25)") + "\n" +
@@ -376,7 +377,7 @@ std::string HelpMessage()
" -blockmaxsize=<n> " + _("Set maximum block size in bytes (default: 250000)") + "\n" +
" -blockprioritysize=<n> " + _("Set maximum size of high-priority/low-fee transactions in bytes (default: 27000)") + "\n" +
"\n" + _("SSL options: (see the CasinoCoin Wiki for SSL setup instructions)") + "\n" +
"\n" + "SSL options: (see the "+ COIN_NAME_DISPLAY + " Wiki for SSL setup instructions)" + "\n" +
" -rpcssl " + _("Use OpenSSL (https) for JSON-RPC connections") + "\n" +
" -rpcsslcertificatechainfile=<file.cert> " + _("Server certificate file (default: server.cert)") + "\n" +
" -rpcsslprivatekeyfile=<file.pem> " + _("Server private key (default: server.pem)") + "\n" +
@@ -645,12 +646,13 @@ bool AppInit2(boost::thread_group& threadGroup)
if (file) fclose(file);
static boost::interprocess::file_lock lock(pathLockFile.string().c_str());
if (!lock.try_lock())
return InitError(strprintf(_("Cannot obtain a lock on data directory %s. CasinoCoin is probably already running."), strDataDir.c_str()));
return InitError(strprintf((std::string("Cannot obtain a lock on data directory %s. ")+ COIN_NAME_DISPLAY + " is probably already running.").c_str(), strDataDir.c_str()));
if (GetBoolArg("-shrinkdebugfile", !fDebug))
ShrinkDebugFile();
printf("\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n");
printf("CasinoCoin version %s (%s)\n", FormatFullVersion().c_str(), CLIENT_DATE.c_str());
std::string versionString = COIN_NAME_DISPLAY + " version %s (%s)\n";
printf(versionString.c_str(), FormatFullVersion().c_str(), CLIENT_DATE.c_str());
printf("Using OpenSSL version %s\n", SSLeay_version(SSLEAY_VERSION));
if (!fLogTimestamps)
printf("Startup time: %s\n", DateTimeStrFormat("%Y-%m-%d %H:%M:%S", GetTime()).c_str());
@@ -660,8 +662,9 @@ bool AppInit2(boost::thread_group& threadGroup)
std::ostringstream strErrors;
if (fDaemon)
fprintf(stdout, "CasinoCoin server starting\n");
{
fprintf(stdout, "%s server starting\n", COIN_NAME_DISPLAY.c_str());
}
if (nScriptCheckThreads) {
printf("Using %u threads for script verification\n", nScriptCheckThreads);
for (int i=0; i<nScriptCheckThreads-1; i++)
@@ -683,7 +686,7 @@ bool AppInit2(boost::thread_group& threadGroup)
{
// try moving the database env out of the way
boost::filesystem::path pathDatabase = GetDataDir() / "database";
boost::filesystem::path pathDatabaseBak = GetDataDir() / strprintf("database.%"PRI64d".bak", GetTime());
boost::filesystem::path pathDatabaseBak = GetDataDir() / strprintf("database.%" PRI64d ".bak", GetTime());
try {
boost::filesystem::rename(pathDatabase, pathDatabaseBak);
printf("Moved old %s to %s. Retrying.\n", pathDatabase.string().c_str(), pathDatabaseBak.string().c_str());
@@ -947,7 +950,7 @@ bool AppInit2(boost::thread_group& threadGroup)
printf("Shutdown requested. Exiting.\n");
return false;
}
printf(" block index %15"PRI64d"ms\n", GetTimeMillis() - nStart);
printf(" block index %15" PRI64d "ms\n", GetTimeMillis() - nStart);
if (GetBoolArg("-printblockindex") || GetBoolArg("-printblocktree"))
{
@@ -1001,10 +1004,10 @@ bool AppInit2(boost::thread_group& threadGroup)
InitWarning(msg);
}
else if (nLoadWalletRet == DB_TOO_NEW)
strErrors << _("Error loading wallet.dat: Wallet requires newer version of CasinoCoin") << "\n";
strErrors << "Error loading wallet.dat: Wallet requires newer version of " << COIN_NAME_DISPLAY << "\n";
else if (nLoadWalletRet == DB_NEED_REWRITE)
{
strErrors << _("Wallet needed to be rewritten: restart CasinoCoin to complete") << "\n";
strErrors << "Wallet needed to be rewritten: restart "<< COIN_NAME_DISPLAY << " to complete" << "\n";
printf("%s", strErrors.str().c_str());
return InitError(strErrors.str());
}
@@ -1044,7 +1047,7 @@ bool AppInit2(boost::thread_group& threadGroup)
}
printf("%s", strErrors.str().c_str());
printf(" wallet %15"PRI64d"ms\n", GetTimeMillis() - nStart);
printf(" wallet %15" PRI64d "ms\n", GetTimeMillis() - nStart);
RegisterWallet(pwalletMain);
@@ -1066,7 +1069,7 @@ bool AppInit2(boost::thread_group& threadGroup)
printf("Rescanning last %i blocks (from block %i)...\n", pindexBest->nHeight - pindexRescan->nHeight, pindexRescan->nHeight);
nStart = GetTimeMillis();
pwalletMain->ScanForWalletTransactions(pindexRescan, true);
printf(" rescan %15"PRI64d"ms\n", GetTimeMillis() - nStart);
printf(" rescan %15" PRI64d "ms\n", GetTimeMillis() - nStart);
pwalletMain->SetBestChain(CBlockLocator(pindexBest));
nWalletDBUpdated++;
}
@@ -1099,7 +1102,7 @@ bool AppInit2(boost::thread_group& threadGroup)
printf("Invalid or missing peers.dat; recreating\n");
}
printf("Loaded %i addresses from peers.dat %"PRI64d"ms\n",
printf("Loaded %i addresses from peers.dat %" PRI64d "ms\n",
addrman.size(), GetTimeMillis() - nStart);
// ********************************************************* Step 11: start node
@@ -1113,11 +1116,11 @@ bool AppInit2(boost::thread_group& threadGroup)
RandAddSeedPerfmon();
//// debug print
printf("mapBlockIndex.size() = %"PRIszu"\n", mapBlockIndex.size());
printf("mapBlockIndex.size() = %" PRIszu "\n", mapBlockIndex.size());
printf("nBestHeight = %d\n", nBestHeight);
printf("setKeyPool.size() = %"PRIszu"\n", pwalletMain ? pwalletMain->setKeyPool.size() : 0);
printf("mapWallet.size() = %"PRIszu"\n", pwalletMain ? pwalletMain->mapWallet.size() : 0);
printf("mapAddressBook.size() = %"PRIszu"\n", pwalletMain ? pwalletMain->mapAddressBook.size() : 0);
printf("setKeyPool.size() = %" PRIszu "\n", pwalletMain ? pwalletMain->setKeyPool.size() : 0);
printf("mapWallet.size() = %" PRIszu "\n", pwalletMain ? pwalletMain->mapWallet.size() : 0);
printf("mapAddressBook.size() = %" PRIszu "\n", pwalletMain ? pwalletMain->mapAddressBook.size() : 0);
StartNode(threadGroup);

View File

@@ -66,7 +66,7 @@ map<uint256, set<uint256> > mapOrphanTransactionsByPrev;
// Constant stuff for coinbase transactions we create:
CScript COINBASE_FLAGS;
const string strMessageMagic = "CasinoCoin Signed Message:\n";
const string strMessageMagic = COIN_NAME_DISPLAY + " Signed Message:\n";
double dHashesPerSec = 0.0;
int64 nHPSTimerStart = 0;
@@ -309,7 +309,7 @@ bool AddOrphanTx(const CTransaction& tx)
BOOST_FOREACH(const CTxIn& txin, tx.vin)
mapOrphanTransactionsByPrev[txin.prevout.hash].insert(hash);
printf("stored orphan tx %s (mapsz %"PRIszu")\n", hash.ToString().c_str(),
printf("stored orphan tx %s (mapsz %" PRIszu ")\n", hash.ToString().c_str(),
mapOrphanTransactions.size());
return true;
}
@@ -755,7 +755,7 @@ bool CTxMemPool::accept(CValidationState &state, CTransaction &tx, bool fCheckIn
// Don't accept it if it can't get into a block
int64 txMinFee = tx.GetMinFee(1000, true, GMF_RELAY);
if (fLimitFree && nFees < txMinFee)
return error("CTxMemPool::accept() : not enough fees %s, %"PRI64d" < %"PRI64d,
return error("CTxMemPool::accept() : not enough fees %s, %" PRI64d " < %" PRI64d,
hash.ToString().c_str(),
nFees, txMinFee);
@@ -1239,7 +1239,7 @@ unsigned int static GetNextWorkRequired_V1(const CBlockIndex* pindexLast, const
// Limit adjustment step
int64 nActualTimespan = pindexLast->GetBlockTime() - pindexFirst->GetBlockTime();
printf(" nActualTimespan = %"PRI64d" before bounds\n", nActualTimespan);
printf(" nActualTimespan = %" PRI64d " before bounds\n", nActualTimespan);
if (nActualTimespan < nTargetTimespan/4)
nActualTimespan = nTargetTimespan/4;
if (nActualTimespan > nTargetTimespan*4)
@@ -1256,7 +1256,7 @@ unsigned int static GetNextWorkRequired_V1(const CBlockIndex* pindexLast, const
/// debug print
printf("Difficulty Retarget - GetNextWorkRequired_V1 RETARGET\n");
printf("nTargetTimespan = %"PRI64d" nActualTimespan = %"PRI64d"\n", nTargetTimespan, nActualTimespan);
printf("nTargetTimespan = %" PRI64d " nActualTimespan = %" PRI64d "\n", nTargetTimespan, nActualTimespan);
printf("Before: %08x %s\n", pindexLast->nBits, CBigNum().SetCompact(pindexLast->nBits).getuint256().ToString().c_str());
printf("After: %08x %s\n", bnNew.GetCompact(), bnNew.getuint256().ToString().c_str());
@@ -1390,7 +1390,7 @@ unsigned int static DigiShield(const CBlockIndex* pindexLast, const CBlockHeader
// Limit adjustment step
int64 nActualTimespan = pindexLast->GetBlockTime() - pindexFirst->GetBlockTime();
printf(" nActualTimespan = %"PRI64d" before bounds\n", nActualTimespan);
printf(" nActualTimespan = %" PRI64d " before bounds\n", nActualTimespan);
@@ -1406,7 +1406,7 @@ unsigned int static DigiShield(const CBlockIndex* pindexLast, const CBlockHeader
/// debug print
printf("DigiShield RETARGET \n");
printf("retargetTimespan = %"PRI64d" nActualTimespan = %"PRI64d"\n", retargetTimespan, nActualTimespan);
printf("retargetTimespan = %" PRI64d " nActualTimespan = %" PRI64d "\n", retargetTimespan, nActualTimespan);
printf("Before: %08x %s\n", pindexLast->nBits, CBigNum().SetCompact(pindexLast->nBits).getuint256().ToString().c_str());
printf("After: %08x %s\n", bnNew.GetCompact(), bnNew.getuint256().ToString().c_str());
@@ -1964,7 +1964,7 @@ bool CBlock::ConnectBlock(CValidationState &state, CBlockIndex* pindex, CCoinsVi
printf("- Connect %u transactions: %.2fms (%.3fms/tx, %.3fms/txin)\n", (unsigned)vtx.size(), 0.001 * nTime, 0.001 * nTime / vtx.size(), nInputs <= 1 ? 0 : 0.001 * nTime / (nInputs-1));
if (vtx[0].GetValueOut() > GetBlockValue(pindex->nHeight, nFees))
return state.DoS(100, error("ConnectBlock() : coinbase pays too much (actual=%"PRI64d" vs limit=%"PRI64d")", vtx[0].GetValueOut(), GetBlockValue(pindex->nHeight, nFees)));
return state.DoS(100, error("ConnectBlock() : coinbase pays too much (actual=%" PRI64d " vs limit=%" PRI64d ")", vtx[0].GetValueOut(), GetBlockValue(pindex->nHeight, nFees)));
if (!control.Wait())
return state.DoS(100, false);
@@ -2044,8 +2044,8 @@ bool SetBestChain(CValidationState &state, CBlockIndex* pindexNew)
reverse(vConnect.begin(), vConnect.end());
if (vDisconnect.size() > 0) {
printf("REORGANIZE: Disconnect %"PRIszu" blocks; %s..\n", vDisconnect.size(), pfork->GetBlockHash().ToString().c_str());
printf("REORGANIZE: Connect %"PRIszu" blocks; ..%s\n", vConnect.size(), pindexNew->GetBlockHash().ToString().c_str());
printf("REORGANIZE: Disconnect %" PRIszu " blocks; %s..\n", vDisconnect.size(), pfork->GetBlockHash().ToString().c_str());
printf("REORGANIZE: Connect %" PRIszu " blocks; ..%s\n", vConnect.size(), pindexNew->GetBlockHash().ToString().c_str());
}
// Disconnect shorter branch
@@ -3153,7 +3153,7 @@ void PrintBlockTree()
// print item
CBlock block;
block.ReadFromDisk(pindex);
printf("%d (blk%05u.dat:0x%x) %s tx %"PRIszu"",
printf("%d (blk%05u.dat:0x%x) %s tx %" PRIszu "",
pindex->nHeight,
pindex->GetBlockPos().nFile, pindex->GetBlockPos().nPos,
DateTimeStrFormat("%Y-%m-%d %H:%M:%S", block.GetBlockTime()).c_str(),
@@ -3246,7 +3246,7 @@ bool LoadExternalBlockFile(FILE* fileIn, CDiskBlockPos *dbp)
AbortNode(_("Error: system error: ") + e.what());
}
if (nLoaded > 0)
printf("Loaded %i blocks from external file in %"PRI64d"ms\n", nLoaded, GetTimeMillis() - nStart);
printf("Loaded %i blocks from external file in %" PRI64d "ms\n", nLoaded, GetTimeMillis() - nStart);
return nLoaded > 0;
}
@@ -3498,7 +3498,7 @@ bool static ProcessMessage(CNode* pfrom, string strCommand, CDataStream& vRecv)
{
RandAddSeedPerfmon();
if (fDebug)
printf("received: %s (%"PRIszu" bytes)\n", strCommand.c_str(), vRecv.size());
printf("received: %s (%" PRIszu " bytes)\n", strCommand.c_str(), vRecv.size());
if (mapArgs.count("-dropmessagestest") && GetRand(atoi(mapArgs["-dropmessagestest"])) == 0)
{
printf("dropmessagestest DROPPING RECV MESSAGE\n");
@@ -3637,7 +3637,7 @@ bool static ProcessMessage(CNode* pfrom, string strCommand, CDataStream& vRecv)
if (vAddr.size() > 1000)
{
pfrom->Misbehaving(20);
return error("message addr size() = %"PRIszu"", vAddr.size());
return error("message addr size() = %" PRIszu "", vAddr.size());
}
// Store the new addresses
@@ -3700,7 +3700,7 @@ bool static ProcessMessage(CNode* pfrom, string strCommand, CDataStream& vRecv)
if (vInv.size() > MAX_INV_SZ)
{
pfrom->Misbehaving(20);
return error("message inv size() = %"PRIszu"", vInv.size());
return error("message inv size() = %" PRIszu "", vInv.size());
}
// find last block in inv vector
@@ -3749,11 +3749,11 @@ bool static ProcessMessage(CNode* pfrom, string strCommand, CDataStream& vRecv)
if (vInv.size() > MAX_INV_SZ)
{
pfrom->Misbehaving(20);
return error("message getdata size() = %"PRIszu"", vInv.size());
return error("message getdata size() = %" PRIszu "", vInv.size());
}
if (fDebugNet || (vInv.size() != 1))
printf("received getdata (%"PRIszu" invsz)\n", vInv.size());
printf("received getdata (%" PRIszu " invsz)\n", vInv.size());
if ((fDebugNet && vInv.size() > 0) || (vInv.size() == 1))
printf("received getdata for: %s\n", vInv[0].ToString().c_str());
@@ -3854,7 +3854,7 @@ bool static ProcessMessage(CNode* pfrom, string strCommand, CDataStream& vRecv)
vWorkQueue.push_back(inv.hash);
vEraseQueue.push_back(inv.hash);
printf("AcceptToMemoryPool: %s %s : accepted %s (poolsz %"PRIszu")\n",
printf("AcceptToMemoryPool: %s %s : accepted %s (poolsz %" PRIszu ")\n",
pfrom->addr.ToString().c_str(), pfrom->cleanSubVer.c_str(),
tx.GetHash().ToString().c_str(),
mempool.mapTx.size());
@@ -4703,7 +4703,7 @@ CBlockTemplate* CreateNewBlock(const CScript& scriptPubKeyIn)
nLastBlockTx = nBlockTx;
nLastBlockSize = nBlockSize;
printf("CreateNewBlock(): total size %"PRI64u"\n", nBlockSize);
printf("CreateNewBlock(): total size %" PRI64u "\n", nBlockSize);
pblock->vtx[0].vout[0].nValue = GetBlockValue(pindexPrev->nHeight+1, nFees);
pblocktemplate->vTxFees[0] = -nFees;
@@ -4866,7 +4866,7 @@ void static CasinoCoinMiner(CWallet *pwallet)
CBlock *pblock = &pblocktemplate->block;
IncrementExtraNonce(pblock, pindexPrev, nExtraNonce);
printf("Running CasinoCoinMiner with %"PRIszu" transactions in block (%u bytes)\n", pblock->vtx.size(),
printf("Running CasinoCoinMiner with %" PRIszu " transactions in block (%u bytes)\n", pblock->vtx.size(),
::GetSerializeSize(*pblock, SER_NETWORK, PROTOCOL_VERSION));
//

View File

@@ -448,7 +448,7 @@ public:
{
if (scriptPubKey.size() < 6)
return "CTxOut(error)";
return strprintf("CTxOut(nValue=%"PRI64d".%08"PRI64d", scriptPubKey=%s)", nValue / COIN, nValue % COIN, scriptPubKey.ToString().substr(0,30).c_str());
return strprintf("CTxOut(nValue=%" PRI64d ".%08" PRI64d ", scriptPubKey=%s)", nValue / COIN, nValue % COIN, scriptPubKey.ToString().substr(0,30).c_str());
}
void print() const
@@ -644,7 +644,7 @@ void UpdateCoins(const CTransaction& tx, CValidationState &state, CCoinsViewCach
std::string ToString() const
{
std::string str;
str += strprintf("CTransaction(hash=%s, ver=%d, vin.size=%"PRIszu", vout.size=%"PRIszu", nLockTime=%u)\n",
str += strprintf("CTransaction(hash=%s, ver=%d, vin.size=%" PRIszu ", vout.size=%" PRIszu ", nLockTime=%u)\n",
GetHash().ToString().c_str(),
nVersion,
vin.size(),
@@ -1488,7 +1488,7 @@ public:
void print() const
{
printf("CBlock(hash=%s, input=%s, PoW=%s, ver=%d, hashPrevBlock=%s, hashMerkleRoot=%s, nTime=%u, nBits=%08x, nNonce=%u, vtx=%"PRIszu")\n",
printf("CBlock(hash=%s, input=%s, PoW=%s, ver=%d, hashPrevBlock=%s, hashMerkleRoot=%s, nTime=%u, nBits=%08x, nNonce=%u, vtx=%" PRIszu ")\n",
GetHash().ToString().c_str(),
HexStr(BEGIN(nVersion),BEGIN(nVersion)+80,false).c_str(),
GetPoWHash().ToString().c_str(),

View File

@@ -1262,7 +1262,7 @@ void DumpAddresses()
CAddrDB adb;
adb.Write(addrman);
printf("Flushed %d addresses to peers.dat %"PRI64d"ms\n",
printf("Flushed %d addresses to peers.dat %" PRI64d "ms\n",
addrman.size(), GetTimeMillis() - nStart);
}

View File

@@ -366,7 +366,7 @@ public:
else
nRequestTime = 0;
if (fDebugNet)
printf("askfor %s %"PRI64d" (%s)\n", inv.ToString().c_str(), nRequestTime, DateTimeStrFormat("%H:%M:%S", nRequestTime/1000000).c_str());
printf("askfor %s %" PRI64d " (%s)\n", inv.ToString().c_str(), nRequestTime, DateTimeStrFormat("%H:%M:%S", nRequestTime/1000000).c_str());
// Make sure not to reuse time indexes to keep things in the same order
int64 nNow = (GetTime() - 1) * 1000000;

View File

@@ -3,6 +3,7 @@
#include "guiconstants.h"
#include "walletmodel.h"
#include "version.h"
#include <QMessageBox>
#include <QPushButton>
@@ -98,7 +99,8 @@ void AskPassphraseDialog::accept()
break;
}
QMessageBox::StandardButton retval = QMessageBox::question(this, tr("Confirm wallet encryption"),
tr("Warning: If you encrypt your wallet and lose your passphrase, you will <b>LOSE ALL OF YOUR CASINOCOINS</b>!") + "<br><br>" + tr("Are you sure you wish to encrypt your wallet?"),
tr((std::string("Warning: If you encrypt your wallet and lose your passphrase, you will <b>LOSE ALL OF YOUR ")
+ COIN_NAME_DISPLAY + "</b>!").c_str()) + "<br><br>" + tr("Are you sure you wish to encrypt your wallet?"),
QMessageBox::Yes|QMessageBox::Cancel,
QMessageBox::Cancel);
if(retval == QMessageBox::Yes)
@@ -109,9 +111,9 @@ void AskPassphraseDialog::accept()
{
QMessageBox::warning(this, tr("Wallet encrypted"),
"<qt>" +
tr("CasinoCoin will close now to finish the encryption process. "
tr((std::string("")+ COIN_NAME_DISPLAY + " will close now to finish the encryption process. "
"Remember that encrypting your wallet cannot fully protect "
"your casinocoins from being stolen by malware infecting your computer.") +
"your "+ COIN_NAME + " from being stolen by malware infecting your computer.").c_str()) +
"<br><br><b>" +
tr("IMPORTANT: Any previous backups you have made of your wallet file "
"should be replaced with the newly generated, encrypted wallet file. "

View File

@@ -110,7 +110,7 @@ static std::string Translate(const char* psz)
static void handleRunawayException(std::exception *e)
{
PrintExceptionContinue(e, "Runaway exception");
QMessageBox::critical(0, "Runaway exception", BitcoinGUI::tr("A fatal error occurred. CasinoCoin can no longer continue safely and will quit.") + QString("\n\n") + QString::fromStdString(strMiscWarning));
QMessageBox::critical(0, "Runaway exception", BitcoinGUI::tr(("A fatal error occurred. "+ COIN_NAME_DISPLAY + " can no longer continue safely and will quit.").c_str()) + QString("\n\n") + QString::fromStdString(strMiscWarning));
exit(1);
}
@@ -146,7 +146,7 @@ int main(int argc, char *argv[])
{
// This message can not be translated, as translation is not initialized yet
// (which not yet possible because lang=XX can be overridden in bitcoin.conf in the data directory)
QMessageBox::critical(0, "CasinoCoin",
QMessageBox::critical(0, COIN_NAME_DISPLAY.c_str(),
QString("Error: Specified data directory \"%1\" does not exist.").arg(QString::fromStdString(mapArgs["-datadir"])));
return 1;
}
@@ -154,12 +154,12 @@ int main(int argc, char *argv[])
// Application identification (must be set before OptionsModel is initialized,
// as it is used to locate QSettings)
QApplication::setOrganizationName("CasinoCoin");
QApplication::setOrganizationName(COIN_NAME_DISPLAY.c_str());
QApplication::setOrganizationDomain("casinocoin.org");
if(GetBoolArg("-testnet")) // Separate UI settings for testnet
QApplication::setApplicationName("CasinoCoin-Qt-testnet");
QApplication::setApplicationName((""+ COIN_NAME_DISPLAY + "-Qt-testnet").c_str());
else
QApplication::setApplicationName("CasinoCoin-Qt");
QApplication::setApplicationName((""+ COIN_NAME_DISPLAY + "-Qt").c_str());
// ... then GUI settings:
OptionsModel optionsModel;

View File

@@ -1,4 +1,5 @@
#include <QtGlobal>
#include "version.h"
// Automatically generated by extract_strings.py
#ifdef __GNUC__
#define UNUSED __attribute__((unused))
@@ -6,18 +7,19 @@
#define UNUSED
#endif
static const char UNUSED *bitcoin_strings[] = {
QT_TRANSLATE_NOOP("bitcoin-core", ""
"%s, you must set a rpcpassword in the configuration file:\n"
"%s\n"
"It is recommended you use the following random password:\n"
"rpcuser=casinocoinrpc\n"
"rpcpassword=%s\n"
"(you do not need to remember this password)\n"
"The username and password MUST NOT be the same.\n"
"If the file does not exist, create it with owner-readable-only file "
"permissions.\n"
"It is also recommended to set alertnotify so you are notified of problems;\n"
"for example: alertnotify=echo %%s | mail -s \"CasinoCoin Alert\" admin@foo.com\n"),
QT_TRANSLATE_NOOP("bitcoin-core", (std::string("") +
"%s, you must set a rpcpassword in the configuration file:\n" +
"%s\n" +
"It is recommended you use the following random password:\n" +
"rpcuser=" + COIN_NAME +"rpc\n" +
"rpcpassword=%s\n" +
"(you do not need to remember this password)\n" +
"The username and password MUST NOT be the same.\n" +
"If the file does not exist, create it with owner-readable-only file " +
"permissions.\n" +
"It is also recommended to set alertnotify so you are notified of problems;\n" +
"for example: alertnotify=echo %%s | mail -s \"" + COIN_NAME_DISPLAY +
" Alert\" admin@foo.com\n").c_str()),
QT_TRANSLATE_NOOP("bitcoin-core", ""
"Acceptable ciphers (default: TLSv1+HIGH:!SSLv2:!aNULL:!eNULL:!AH:!3DES:"
"@STRENGTH)"),
@@ -29,9 +31,9 @@ QT_TRANSLATE_NOOP("bitcoin-core", ""
QT_TRANSLATE_NOOP("bitcoin-core", ""
"Bind to given address and always listen on it. Use [host]:port notation for "
"IPv6"),
QT_TRANSLATE_NOOP("bitcoin-core", ""
"Cannot obtain a lock on data directory %s. CasinoCoin is probably already "
"running."),
QT_TRANSLATE_NOOP("bitcoin-core", (std::string("") +
"Cannot obtain a lock on data directory %s. "+ COIN_NAME_DISPLAY + " is probably already "
"running.").c_str()),
QT_TRANSLATE_NOOP("bitcoin-core", ""
"Error: The transaction was rejected! This might happen if some of the coins "
"in your wallet were already spent, such as if you used a copy of wallet.dat "
@@ -62,17 +64,17 @@ QT_TRANSLATE_NOOP("bitcoin-core", ""
QT_TRANSLATE_NOOP("bitcoin-core", ""
"This is a pre-release test build - use at your own risk - do not use for "
"mining or merchant applications"),
QT_TRANSLATE_NOOP("bitcoin-core", ""
"Unable to bind to %s on this computer. CasinoCoin is probably already running."),
QT_TRANSLATE_NOOP("bitcoin-core", (std::string("") +
"Unable to bind to %s on this computer. "+ COIN_NAME_DISPLAY + " is probably already running.").c_str()),
QT_TRANSLATE_NOOP("bitcoin-core", ""
"Warning: -paytxfee is set very high! This is the transaction fee you will "
"pay if you send a transaction."),
QT_TRANSLATE_NOOP("bitcoin-core", ""
"Warning: Displayed transactions may not be correct! You may need to upgrade, "
"or other nodes may need to upgrade."),
QT_TRANSLATE_NOOP("bitcoin-core", ""
QT_TRANSLATE_NOOP("bitcoin-core", (std::string("") +
"Warning: Please check that your computer's date and time are correct! If "
"your clock is wrong CasinoCoin will not work properly."),
"your clock is wrong "+ COIN_NAME_DISPLAY + " will not work properly.").c_str()),
QT_TRANSLATE_NOOP("bitcoin-core", ""
"Warning: error reading wallet.dat! All keys read correctly, but transaction "
"data or address book entries might be missing or incorrect."),
@@ -91,7 +93,7 @@ QT_TRANSLATE_NOOP("bitcoin-core", "Add a node to connect to and attempt to keep
QT_TRANSLATE_NOOP("bitcoin-core", "Allow DNS lookups for -addnode, -seednode and -connect"),
QT_TRANSLATE_NOOP("bitcoin-core", "Allow JSON-RPC connections from specified IP address"),
QT_TRANSLATE_NOOP("bitcoin-core", "Attempt to recover private keys from a corrupt wallet.dat"),
QT_TRANSLATE_NOOP("bitcoin-core", "CasinoCoin version"),
QT_TRANSLATE_NOOP("bitcoin-core", (COIN_NAME_DISPLAY + " version").c_str()),
QT_TRANSLATE_NOOP("bitcoin-core", "Block creation options:"),
QT_TRANSLATE_NOOP("bitcoin-core", "Cannot downgrade wallet"),
QT_TRANSLATE_NOOP("bitcoin-core", "Cannot resolve -bind address: '%s'"),
@@ -109,7 +111,7 @@ QT_TRANSLATE_NOOP("bitcoin-core", "Error initializing wallet database environmen
QT_TRANSLATE_NOOP("bitcoin-core", "Error loading block database"),
QT_TRANSLATE_NOOP("bitcoin-core", "Error loading wallet.dat"),
QT_TRANSLATE_NOOP("bitcoin-core", "Error loading wallet.dat: Wallet corrupted"),
QT_TRANSLATE_NOOP("bitcoin-core", "Error loading wallet.dat: Wallet requires newer version of CasinoCoin"),
QT_TRANSLATE_NOOP("bitcoin-core", (std::string("Error loading wallet.dat: Wallet requires newer version of ")+ COIN_NAME_DISPLAY + "").c_str()),
QT_TRANSLATE_NOOP("bitcoin-core", "Error opening block database"),
QT_TRANSLATE_NOOP("bitcoin-core", "Error"),
QT_TRANSLATE_NOOP("bitcoin-core", "Error: Disk space is low!"),
@@ -162,9 +164,9 @@ QT_TRANSLATE_NOOP("bitcoin-core", "Rebuild block chain index from current blk000
QT_TRANSLATE_NOOP("bitcoin-core", "Rescan the block chain for missing wallet transactions"),
QT_TRANSLATE_NOOP("bitcoin-core", "Rescanning..."),
QT_TRANSLATE_NOOP("bitcoin-core", "Run in the background as a daemon and accept commands"),
QT_TRANSLATE_NOOP("bitcoin-core", "SSL options: (see the CasinoCoin Wiki for SSL setup instructions)"),
QT_TRANSLATE_NOOP("bitcoin-core", (std::string("SSL options: (see the ") + COIN_NAME_DISPLAY + " Wiki for SSL setup instructions)").c_str()),
QT_TRANSLATE_NOOP("bitcoin-core", "Select the version of socks proxy to use (4-5, default: 5)"),
QT_TRANSLATE_NOOP("bitcoin-core", "Send command to -server or casinocoind"),
QT_TRANSLATE_NOOP("bitcoin-core", (std::string("Send command to -server or ") + COIN_NAME + "d").c_str()),
QT_TRANSLATE_NOOP("bitcoin-core", "Send commands to node running on <ip> (default: 127.0.0.1)"),
QT_TRANSLATE_NOOP("bitcoin-core", "Send trace/debug info to console instead of debug.log file"),
QT_TRANSLATE_NOOP("bitcoin-core", "Send trace/debug info to debugger"),
@@ -177,10 +179,10 @@ QT_TRANSLATE_NOOP("bitcoin-core", "Set minimum block size in bytes (default: 0)"
QT_TRANSLATE_NOOP("bitcoin-core", "Set the number of threads to service RPC calls (default: 4)"),
QT_TRANSLATE_NOOP("bitcoin-core", "Shrink debug.log file on client startup (default: 1 when no -debug)"),
QT_TRANSLATE_NOOP("bitcoin-core", "Signing transaction failed"),
QT_TRANSLATE_NOOP("bitcoin-core", "Specify configuration file (default: casinocoin.conf)"),
QT_TRANSLATE_NOOP("bitcoin-core", (std::string("Specify configuration file (default: ") + COIN_NAME + ".conf)").c_str()),
QT_TRANSLATE_NOOP("bitcoin-core", "Specify connection timeout in milliseconds (default: 5000)"),
QT_TRANSLATE_NOOP("bitcoin-core", "Specify data directory"),
QT_TRANSLATE_NOOP("bitcoin-core", "Specify pid file (default: casinocoind.pid)"),
QT_TRANSLATE_NOOP("bitcoin-core", (std::string("Specify pid file (default: ") + COIN_NAME + "d.pid)").c_str()),
QT_TRANSLATE_NOOP("bitcoin-core", "Specify your own public address"),
QT_TRANSLATE_NOOP("bitcoin-core", "System error: "),
QT_TRANSLATE_NOOP("bitcoin-core", "This help message"),
@@ -202,7 +204,7 @@ QT_TRANSLATE_NOOP("bitcoin-core", "Use the test network"),
QT_TRANSLATE_NOOP("bitcoin-core", "Username for JSON-RPC connections"),
QT_TRANSLATE_NOOP("bitcoin-core", "Verifying blocks..."),
QT_TRANSLATE_NOOP("bitcoin-core", "Verifying wallet..."),
QT_TRANSLATE_NOOP("bitcoin-core", "Wallet needed to be rewritten: restart CasinoCoin to complete"),
QT_TRANSLATE_NOOP("bitcoin-core", (std::string("Wallet needed to be rewritten: restart ")+ COIN_NAME_DISPLAY + " to complete").c_str()),
QT_TRANSLATE_NOOP("bitcoin-core", "Warning"),
QT_TRANSLATE_NOOP("bitcoin-core", "Warning: This version is obsolete, upgrade required!"),
QT_TRANSLATE_NOOP("bitcoin-core", "You need to rebuild the database using -reindex to change -txindex"),

View File

@@ -84,7 +84,7 @@ void setupAmountWidget(QLineEdit *widget, QWidget *parent)
bool parseBitcoinURI(const QUrl &uri, SendCoinsRecipient *out)
{
// return if URI is not valid or is no bitcoin URI
if(!uri.isValid() || uri.scheme() != QString("casinocoin"))
if(!uri.isValid() || uri.scheme() != QString(COIN_NAME.c_str()))
return false;
SendCoinsRecipient rv;
@@ -139,9 +139,9 @@ bool parseBitcoinURI(QString uri, SendCoinsRecipient *out)
//
// Cannot handle this later, because bitcoin:// will cause Qt to see the part after // as host,
// which will lower-case it (and thus invalidate the address).
if(uri.startsWith("casinocoin://"))
if(uri.startsWith(QString((COIN_NAME + "://").c_str())))
{
uri.replace(0, 11, "casinocoin:");
uri.replace(0, (COIN_NAME.length()+1), QString((COIN_NAME + ":").c_str()));
}
QUrl uriInstance(uri);
return parseBitcoinURI(uriInstance, out);
@@ -301,7 +301,7 @@ bool ToolTipToRichTextFilter::eventFilter(QObject *obj, QEvent *evt)
#ifdef WIN32
boost::filesystem::path static StartupShortcutPath()
{
return GetSpecialFolderPath(CSIDL_STARTUP) / "CasinoCoin.lnk";
return GetSpecialFolderPath(CSIDL_STARTUP) / (COIN_NAME_DISPLAY + ".lnk").c_str();
}
bool GetStartOnSystemStartup()
@@ -383,7 +383,7 @@ boost::filesystem::path static GetAutostartDir()
boost::filesystem::path static GetAutostartFilePath()
{
return GetAutostartDir() / "casinocoin.desktop";
return GetAutostartDir() / ""+ COIN_NAME + ".desktop";
}
bool GetStartOnSystemStartup()
@@ -424,7 +424,7 @@ bool SetStartOnSystemStartup(bool fAutoStart)
// Write a bitcoin.desktop file to the autostart directory:
optionFile << "[Desktop Entry]\n";
optionFile << "Type=Application\n";
optionFile << "Name=CasinoCoin\n";
optionFile << "Name="+ COIN_NAME_DISPLAY + "\n";
optionFile << "Exec=" << pszExePath << " -min\n";
optionFile << "Terminal=false\n";
optionFile << "Hidden=false\n";
@@ -495,10 +495,10 @@ bool SetStartOnSystemStartup(bool fAutoStart) { return false; }
HelpMessageBox::HelpMessageBox(QWidget *parent) :
QMessageBox(parent)
{
header = tr("CasinoCoin-Qt") + " " + tr("version") + " " +
header = tr((COIN_NAME_DISPLAY + "-Qt").c_str()) + " " + tr("version") + " " +
QString::fromStdString(FormatFullVersion()) + "\n\n" +
tr("Usage:") + "\n" +
" casinocoin-qt [" + tr("command-line options") + "] " + "\n";
QString::fromStdString(" "+ COIN_NAME + "-qt [") + tr("command-line options") + "] " + "\n";
coreOptions = QString::fromStdString(HelpMessage());
@@ -507,7 +507,7 @@ HelpMessageBox::HelpMessageBox(QWidget *parent) :
" -min " + tr("Start minimized") + "\n" +
" -splash " + tr("Show splash screen on startup (default: 1)") + "\n";
setWindowTitle(tr("CasinoCoin-Qt"));
setWindowTitle(tr((COIN_NAME_DISPLAY + "-Qt").c_str()));
setTextFormat(Qt::PlainText);
// setMinimumWidth is ignored for QMessageBox so put in non-breaking spaces to make it wider.
setText(header + QString(QChar(0x2003)).repeated(50));

View File

@@ -106,7 +106,7 @@ PaymentServer::PaymentServer(QApplication* parent) : QObject(parent), saveURIs(t
uriServer = new QLocalServer(this);
if (!uriServer->listen(name))
qDebug() << tr("Cannot start casinocoin: click-to-pay handler");
qDebug() << tr((std::string("Cannot start ")+ COIN_NAME + ": click-to-pay handler").c_str());
else
connect(uriServer, SIGNAL(newConnection()), this, SLOT(handleURIConnection()));
}

View File

@@ -5,6 +5,7 @@
#include "guiconstants.h"
#include "guiutil.h"
#include "optionsmodel.h"
#include "version.h"
#include <QPixmap>
#if QT_VERSION < 0x050000
@@ -85,7 +86,7 @@ void QRCodeDialog::genCode()
QString QRCodeDialog::getURI()
{
QString ret = QString("casinocoin:%1").arg(address);
QString ret = QString((COIN_NAME + ":%1").c_str()).arg(address);
int paramCount = 0;
ui->outUri->clear();

View File

@@ -36,7 +36,7 @@ Value importprivkey(const Array& params, bool fHelp)
{
if (fHelp || params.size() < 1 || params.size() > 3)
throw runtime_error(
"importprivkey <casinocoinprivkey> [label] [rescan=true]\n"
"importprivkey <"+ COIN_NAME + "privkey> [label] [rescan=true]\n"
"Adds a private key (as returned by dumpprivkey) to your wallet.");
string strSecret = params[0].get_str();
@@ -79,13 +79,13 @@ Value dumpprivkey(const Array& params, bool fHelp)
{
if (fHelp || params.size() != 1)
throw runtime_error(
"dumpprivkey <casinocoinaddress>\n"
"Reveals the private key corresponding to <casinocoinaddress>.");
"dumpprivkey <"+ COIN_NAME + "address>\n"
"Reveals the private key corresponding to <"+ COIN_NAME + "address>.");
string strAddress = params[0].get_str();
CBitcoinAddress address;
if (!address.SetString(strAddress))
throw JSONRPCError(RPC_INVALID_ADDRESS_OR_KEY, "Invalid CasinoCoin address");
throw JSONRPCError(RPC_INVALID_ADDRESS_OR_KEY, "Invalid "+ COIN_NAME_DISPLAY + " address");
CKeyID keyID;
if (!address.GetKeyID(keyID))
throw JSONRPCError(RPC_TYPE_ERROR, "Address does not refer to a key");

View File

@@ -171,10 +171,10 @@ Value getworkex(const Array& params, bool fHelp)
);
if (vNodes.empty())
throw JSONRPCError(RPC_CLIENT_NOT_CONNECTED, "CasinoCoin is not connected!");
throw JSONRPCError(RPC_CLIENT_NOT_CONNECTED, ""+ COIN_NAME_DISPLAY + " is not connected!");
if (IsInitialBlockDownload())
throw JSONRPCError(RPC_CLIENT_IN_INITIAL_DOWNLOAD, "CasinoCoin is downloading blocks...");
throw JSONRPCError(RPC_CLIENT_IN_INITIAL_DOWNLOAD, ""+ COIN_NAME_DISPLAY + " is downloading blocks...");
typedef map<uint256, pair<CBlock*, CScript> > mapNewBlock_t;
static mapNewBlock_t mapNewBlock; // FIXME: thread safety
@@ -311,10 +311,10 @@ Value getwork(const Array& params, bool fHelp)
"If [data] is specified, tries to solve the block and returns true if it was successful.");
if (vNodes.empty())
throw JSONRPCError(RPC_CLIENT_NOT_CONNECTED, "CasinoCoin is not connected!");
throw JSONRPCError(RPC_CLIENT_NOT_CONNECTED, ""+ COIN_NAME_DISPLAY + " is not connected!");
if (IsInitialBlockDownload())
throw JSONRPCError(RPC_CLIENT_IN_INITIAL_DOWNLOAD, "CasinoCoin is downloading blocks...");
throw JSONRPCError(RPC_CLIENT_IN_INITIAL_DOWNLOAD, ""+ COIN_NAME_DISPLAY + " is downloading blocks...");
typedef map<uint256, pair<CBlock*, CScript> > mapNewBlock_t;
static mapNewBlock_t mapNewBlock; // FIXME: thread safety
@@ -453,10 +453,10 @@ Value getblocktemplate(const Array& params, bool fHelp)
throw JSONRPCError(RPC_INVALID_PARAMETER, "Invalid mode");
if (vNodes.empty())
throw JSONRPCError(RPC_CLIENT_NOT_CONNECTED, "CasinoCoin is not connected!");
throw JSONRPCError(RPC_CLIENT_NOT_CONNECTED, ""+ COIN_NAME_DISPLAY + " is not connected!");
if (IsInitialBlockDownload())
throw JSONRPCError(RPC_CLIENT_IN_INITIAL_DOWNLOAD, "CasinoCoin is downloading blocks...");
throw JSONRPCError(RPC_CLIENT_IN_INITIAL_DOWNLOAD, ""+ COIN_NAME_DISPLAY + " is downloading blocks...");
// Update block
static unsigned int nTransactionsUpdatedLast;

View File

@@ -48,7 +48,7 @@ Value getpeerinfo(const Array& params, bool fHelp)
Object obj;
obj.push_back(Pair("addr", stats.addrName));
obj.push_back(Pair("services", strprintf("%08"PRI64x, stats.nServices)));
obj.push_back(Pair("services", strprintf("%08" PRI64x, stats.nServices)));
obj.push_back(Pair("lastsend", (boost::int64_t)stats.nLastSend));
obj.push_back(Pair("lastrecv", (boost::int64_t)stats.nLastRecv));
obj.push_back(Pair("bytessent", (boost::int64_t)stats.nSendBytes));

View File

@@ -195,7 +195,7 @@ Value listunspent(const Array& params, bool fHelp)
{
CBitcoinAddress address(input.get_str());
if (!address.IsValid())
throw JSONRPCError(RPC_INVALID_ADDRESS_OR_KEY, string("Invalid CasinoCoin address: ")+input.get_str());
throw JSONRPCError(RPC_INVALID_ADDRESS_OR_KEY, string("Invalid "+ COIN_NAME_DISPLAY + " address: ")+input.get_str());
if (setAddress.count(address))
throw JSONRPCError(RPC_INVALID_PARAMETER, string("Invalid parameter, duplicated address: ")+input.get_str());
setAddress.insert(address);
@@ -294,7 +294,7 @@ Value createrawtransaction(const Array& params, bool fHelp)
{
CBitcoinAddress address(s.name_);
if (!address.IsValid())
throw JSONRPCError(RPC_INVALID_ADDRESS_OR_KEY, string("Invalid CasinoCoin address: ")+s.name_);
throw JSONRPCError(RPC_INVALID_ADDRESS_OR_KEY, string("Invalid "+ COIN_NAME_DISPLAY + " address: ")+s.name_);
if (setAddress.count(address))
throw JSONRPCError(RPC_INVALID_PARAMETER, string("Invalid parameter, duplicated address: ")+s.name_);

View File

@@ -101,7 +101,7 @@ Value getnewaddress(const Array& params, bool fHelp)
if (fHelp || params.size() > 1)
throw runtime_error(
"getnewaddress [account]\n"
"Returns a new CasinoCoin address for receiving payments. "
"Returns a new " + COIN_NAME_DISPLAY + " address for receiving payments. "
"If [account] is specified (recommended), it is added to the address book "
"so payments received with the address will be credited to [account].");
@@ -145,8 +145,10 @@ CBitcoinAddress GetAccountAddress(string strAccount, bool bForceNew=false)
{
const CWalletTx& wtx = (*it).second;
BOOST_FOREACH(const CTxOut& txout, wtx.vout)
{
if (txout.scriptPubKey == scriptPubKey)
bKeyUsed = true;
}
}
}
@@ -168,7 +170,7 @@ Value getaccountaddress(const Array& params, bool fHelp)
if (fHelp || params.size() != 1)
throw runtime_error(
"getaccountaddress <account>\n"
"Returns the current CasinoCoin address for receiving payments to this account.");
"Returns the current " + COIN_NAME_DISPLAY + " address for receiving payments to this account.");
// Parse the account first so we don't generate a key if there's an error
string strAccount = AccountFromValue(params[0]);
@@ -186,12 +188,12 @@ Value setaccount(const Array& params, bool fHelp)
{
if (fHelp || params.size() < 1 || params.size() > 2)
throw runtime_error(
"setaccount <casinocoinaddress> <account>\n"
"setaccount <" + COIN_NAME + "address> <account>\n"
"Sets the account associated with the given address.");
CBitcoinAddress address(params[0].get_str());
if (!address.IsValid())
throw JSONRPCError(RPC_INVALID_ADDRESS_OR_KEY, "Invalid CasinoCoin address");
throw JSONRPCError(RPC_INVALID_ADDRESS_OR_KEY, "Invalid " + COIN_NAME_DISPLAY + " address");
string strAccount;
@@ -216,12 +218,12 @@ Value getaccount(const Array& params, bool fHelp)
{
if (fHelp || params.size() != 1)
throw runtime_error(
"getaccount <casinocoinaddress>\n"
"getaccount <" + COIN_NAME + "address>\n"
"Returns the account associated with the given address.");
CBitcoinAddress address(params[0].get_str());
if (!address.IsValid())
throw JSONRPCError(RPC_INVALID_ADDRESS_OR_KEY, "Invalid CasinoCoin address");
throw JSONRPCError(RPC_INVALID_ADDRESS_OR_KEY, "Invalid " + COIN_NAME_DISPLAY + " address");
string strAccount;
map<CTxDestination, string>::iterator mi = pwalletMain->mapAddressBook.find(address.Get());
@@ -274,13 +276,13 @@ Value sendtoaddress(const Array& params, bool fHelp)
{
if (fHelp || params.size() < 2 || params.size() > 4)
throw runtime_error(
"sendtoaddress <casinocoinaddress> <amount> [comment] [comment-to]\n"
"sendtoaddress <"+ COIN_NAME + "address> <amount> [comment] [comment-to]\n"
"<amount> is a real and is rounded to the nearest 0.00000001"
+ HelpRequiringPassphrase());
CBitcoinAddress address(params[0].get_str());
if (!address.IsValid())
throw JSONRPCError(RPC_INVALID_ADDRESS_OR_KEY, "Invalid CasinoCoin address");
throw JSONRPCError(RPC_INVALID_ADDRESS_OR_KEY, "Invalid "+ COIN_NAME_DISPLAY + " address");
// Amount
int64 nAmount = AmountFromValue(params[1]);
@@ -337,7 +339,7 @@ Value signmessage(const Array& params, bool fHelp)
{
if (fHelp || params.size() != 2)
throw runtime_error(
"signmessage <casinocoinaddress> <message>\n"
"signmessage <"+ COIN_NAME + "address> <message>\n"
"Sign a message with the private key of an address");
EnsureWalletIsUnlocked();
@@ -372,7 +374,7 @@ Value verifymessage(const Array& params, bool fHelp)
{
if (fHelp || params.size() != 3)
throw runtime_error(
"verifymessage <casinocoinaddress> <signature> <message>\n"
"verifymessage <" + COIN_NAME + "address> <signature> <message>\n"
"Verify a signed message");
string strAddress = params[0].get_str();
@@ -409,14 +411,14 @@ Value getreceivedbyaddress(const Array& params, bool fHelp)
{
if (fHelp || params.size() < 1 || params.size() > 2)
throw runtime_error(
"getreceivedbyaddress <casinocoinaddress> [minconf=1]\n"
"Returns the total amount received by <casinocoinaddress> in transactions with at least [minconf] confirmations.");
"getreceivedbyaddress <" + COIN_NAME + "address> [minconf=1]\n"
"Returns the total amount received by <" + COIN_NAME + "address> in transactions with at least [minconf] confirmations.");
// Bitcoin address
CBitcoinAddress address = CBitcoinAddress(params[0].get_str());
CScript scriptPubKey;
if (!address.IsValid())
throw JSONRPCError(RPC_INVALID_ADDRESS_OR_KEY, "Invalid CasinoCoin address");
throw JSONRPCError(RPC_INVALID_ADDRESS_OR_KEY, "Invalid " + COIN_NAME_DISPLAY + " address");
scriptPubKey.SetDestination(address.Get());
if (!IsMine(*pwalletMain,scriptPubKey))
return (double)0.0;
@@ -630,14 +632,14 @@ Value sendfrom(const Array& params, bool fHelp)
{
if (fHelp || params.size() < 3 || params.size() > 6)
throw runtime_error(
"sendfrom <fromaccount> <tocasinocoinaddress> <amount> [minconf=1] [comment] [comment-to]\n"
"sendfrom <fromaccount> <to"+ COIN_NAME + "address> <amount> [minconf=1] [comment] [comment-to]\n"
"<amount> is a real and is rounded to the nearest 0.00000001"
+ HelpRequiringPassphrase());
string strAccount = AccountFromValue(params[0]);
CBitcoinAddress address(params[1].get_str());
if (!address.IsValid())
throw JSONRPCError(RPC_INVALID_ADDRESS_OR_KEY, "Invalid CasinoCoin address");
throw JSONRPCError(RPC_INVALID_ADDRESS_OR_KEY, "Invalid " + COIN_NAME_DISPLAY + " address");
int64 nAmount = AmountFromValue(params[2]);
int nMinDepth = 1;
if (params.size() > 3)
@@ -693,7 +695,7 @@ Value sendmany(const Array& params, bool fHelp)
{
CBitcoinAddress address(s.name_);
if (!address.IsValid())
throw JSONRPCError(RPC_INVALID_ADDRESS_OR_KEY, string("Invalid CasinoCoin address: ")+s.name_);
throw JSONRPCError(RPC_INVALID_ADDRESS_OR_KEY, string("Invalid " + COIN_NAME_DISPLAY + " address: ")+s.name_);
if (setAddress.count(address))
throw JSONRPCError(RPC_INVALID_PARAMETER, string("Invalid parameter, duplicated address: ")+s.name_);
@@ -789,7 +791,7 @@ Value addmultisigaddress(const Array& params, bool fHelp)
{
string msg = "addmultisigaddress <nrequired> <'[\"key\",\"key\"]'> [account]\n"
"Add a nrequired-to-sign multisignature address to the wallet\"\n"
"each key is a CasinoCoin address or hex-encoded public key\n"
"each key is a " + COIN_NAME_DISPLAY + " address or hex-encoded public key\n"
"If [account] is specified, assign address to [account].";
throw runtime_error(msg);
}
@@ -814,7 +816,7 @@ Value createmultisig(const Array& params, bool fHelp)
string msg = "createmultisig <nrequired> <'[\"key\",\"key\"]'>\n"
"Creates a multi-signature address and returns a json object\n"
"with keys:\n"
"address : casinocoin address\n"
"address : " + COIN_NAME + " address\n"
"redeemScript : hex-encoded redemption script";
throw runtime_error(msg);
}
@@ -1469,7 +1471,7 @@ Value encryptwallet(const Array& params, bool fHelp)
// slack space in .dat files; that is bad if the old data is
// unencrypted private keys. So:
StartShutdown();
return "wallet encrypted; CasinoCoin server stopping, restart to run with encrypted wallet. The keypool has been flushed, you need to make a new backup.";
return "wallet encrypted; " + COIN_NAME_DISPLAY + " server stopping, restart to run with encrypted wallet. The keypool has been flushed, you need to make a new backup.";
}
class DescribeAddressVisitor : public boost::static_visitor<Object>
@@ -1511,8 +1513,8 @@ Value validateaddress(const Array& params, bool fHelp)
{
if (fHelp || params.size() != 1)
throw runtime_error(
"validateaddress <casinocoinaddress>\n"
"Return information about <casinocoinaddress>.");
"validateaddress <"+ COIN_NAME + "address>\n"
"Return information about <"+ COIN_NAME + "address>.");
CBitcoinAddress address(params[0].get_str());
bool isValid = address.IsValid();

View File

@@ -23,7 +23,7 @@ struct TestingSetup {
fPrintToDebugger = true; // don't want to write to debug.log file
noui_connect();
bitdb.MakeMock();
pathTemp = GetTempPath() / strprintf("test_casinocoin_%lu_%i", (unsigned long)GetTime(), (int)(GetRand(100000)));
pathTemp = GetTempPath() / strprintf("test_"+ COIN_NAME + "_%lu_%i", (unsigned long)GetTime(), (int)(GetRand(100000)));
boost::filesystem::create_directories(pathTemp);
mapArgs["-datadir"] = pathTemp.string();
pblocktree = new CBlockTreeDB(1 << 20, true);

View File

@@ -995,7 +995,7 @@ static std::string FormatException(std::exception* pex, const char* pszThread)
char pszModule[MAX_PATH] = "";
GetModuleFileNameA(NULL, pszModule, sizeof(pszModule));
#else
const char* pszModule = "casinocoin";
const char* pszModule = COIN_NAME;
#endif
if (pex)
return strprintf(
@@ -1037,7 +1037,7 @@ boost::filesystem::path GetDefaultDataDir()
// Unix: ~/.bitcoin
#ifdef WIN32
// Windows
return GetSpecialFolderPath(CSIDL_APPDATA) / "CasinoCoin";
return GetSpecialFolderPath(CSIDL_APPDATA) / COIN_NAME_DISPLAY;
#else
fs::path pathRet;
char* pszHome = getenv("HOME");
@@ -1049,10 +1049,10 @@ boost::filesystem::path GetDefaultDataDir()
// Mac
pathRet /= "Library/Application Support";
fs::create_directory(pathRet);
return pathRet / "CasinoCoin";
return pathRet / COIN_NAME_DISPLAY;
#else
// Unix
return pathRet / ".casinocoin";
return pathRet / "."+ COIN_NAME + "";
#endif
#endif
}
@@ -1093,7 +1093,7 @@ const boost::filesystem::path &GetDataDir(bool fNetSpecific)
boost::filesystem::path GetConfigFile()
{
boost::filesystem::path pathConfigFile(GetArg("-conf", "casinocoin.conf"));
boost::filesystem::path pathConfigFile(GetArg("-conf", ""+ COIN_NAME + ".conf"));
if (!pathConfigFile.is_complete()) pathConfigFile = GetDataDir(false) / pathConfigFile;
return pathConfigFile;
}
@@ -1127,7 +1127,7 @@ void ReadConfigFile(map<string, string>& mapSettingsRet,
boost::filesystem::path GetPidFile()
{
boost::filesystem::path pathPidFile(GetArg("-pid", "casinocoind.pid"));
boost::filesystem::path pathPidFile(GetArg("-pid", ""+ COIN_NAME + "d.pid"));
if (!pathPidFile.is_complete()) pathPidFile = GetDataDir() / pathPidFile;
return pathPidFile;
}
@@ -1356,7 +1356,7 @@ void AddTimeData(const CNetAddr& ip, int64 nTime)
if (!fMatch)
{
fDone = true;
string strMessage = _("Warning: Please check that your computer's date and time are correct! If your clock is wrong CasinoCoin will not work properly.");
string strMessage = _("Warning: Please check that your computer's date and time are correct! If your clock is wrong ")+ COIN_NAME_DISPLAY + _(" will not work properly.");
strMiscWarning = strMessage;
printf("*** %s\n", strMessage.c_str());
uiInterface.ThreadSafeMessageBox(strMessage, "", CClientUIInterface::MSG_WARNING);

View File

@@ -242,7 +242,7 @@ void runCommand(std::string strCommand);
inline std::string i64tostr(int64 n)
{
return strprintf("%"PRI64d, n);
return strprintf("%" PRI64d, n);
}
inline std::string itostr(int n)

View File

@@ -21,6 +21,10 @@ extern const std::string CLIENT_NAME;
extern const std::string CLIENT_BUILD;
extern const std::string CLIENT_DATE;
// Coin Name
static const std::string COIN_NAME("casinocoin");
static const std::string COIN_NAME_DISPLAY("CasinoCoin");
//
// network protocol versioning
//

View File

@@ -1487,7 +1487,7 @@ void CWallet::PrintWallet(const CBlock& block)
if (mapWallet.count(block.vtx[0].GetHash()))
{
CWalletTx& wtx = mapWallet[block.vtx[0].GetHash()];
printf(" mine: %d %d %"PRI64d"", wtx.GetDepthInMainChain(), wtx.GetBlocksToMaturity(), wtx.GetCredit());
printf(" mine: %d %d %" PRI64d "", wtx.GetDepthInMainChain(), wtx.GetBlocksToMaturity(), wtx.GetCredit());
}
}
printf("\n");
@@ -1549,7 +1549,7 @@ bool CWallet::NewKeyPool()
walletdb.WritePool(nIndex, CKeyPool(GenerateNewKey()));
setKeyPool.insert(nIndex);
}
printf("CWallet::NewKeyPool wrote %"PRI64d" new keys\n", nKeys);
printf("CWallet::NewKeyPool wrote %" PRI64d " new keys\n", nKeys);
}
return true;
}
@@ -1574,7 +1574,7 @@ bool CWallet::TopUpKeyPool()
if (!walletdb.WritePool(nEnd, CKeyPool(GenerateNewKey())))
throw runtime_error("TopUpKeyPool() : writing generated key failed");
setKeyPool.insert(nEnd);
printf("keypool added key %"PRI64d", size=%"PRIszu"\n", nEnd, setKeyPool.size());
printf("keypool added key %" PRI64d ", size=%" PRIszu "\n", nEnd, setKeyPool.size());
}
}
return true;
@@ -1603,7 +1603,7 @@ void CWallet::ReserveKeyFromKeyPool(int64& nIndex, CKeyPool& keypool)
if (!HaveKey(keypool.vchPubKey.GetID()))
throw runtime_error("ReserveKeyFromKeyPool() : unknown key in key pool");
assert(keypool.vchPubKey.IsValid());
printf("keypool reserve %"PRI64d"\n", nIndex);
printf("keypool reserve %" PRI64d "\n", nIndex);
}
}
@@ -1630,7 +1630,7 @@ void CWallet::KeepKey(int64 nIndex)
CWalletDB walletdb(strWalletFile);
walletdb.ErasePool(nIndex);
}
printf("keypool keep %"PRI64d"\n", nIndex);
printf("keypool keep %" PRI64d "\n", nIndex);
}
void CWallet::ReturnKey(int64 nIndex)
@@ -1640,7 +1640,7 @@ void CWallet::ReturnKey(int64 nIndex)
LOCK(cs_wallet);
setKeyPool.insert(nIndex);
}
printf("keypool return %"PRI64d"\n", nIndex);
printf("keypool return %" PRI64d "\n", nIndex);
}
bool CWallet::GetKeyFromPool(CPubKey& result, bool fAllowReuse)

View File

@@ -520,7 +520,7 @@ void ThreadFlushWalletDB(const string& strFile)
bitdb.CheckpointLSN(strFile);
bitdb.mapFileUseCount.erase(mi++);
printf("Flushed wallet.dat %"PRI64d"ms\n", GetTimeMillis() - nStart);
printf("Flushed wallet.dat %" PRI64d "ms\n", GetTimeMillis() - nStart);
}
}
}
@@ -550,11 +550,7 @@ bool BackupWallet(const CWallet& wallet, const string& strDest)
pathDest /= wallet.strWalletFile;
try {
#if BOOST_VERSION >= 104000
filesystem::copy_file(pathSrc, pathDest, filesystem::copy_option::overwrite_if_exists);
#else
filesystem::copy_file(pathSrc, pathDest);
#endif
printf("copied wallet.dat to %s\n", pathDest.string().c_str());
return true;
} catch(const filesystem::filesystem_error &e) {
@@ -581,7 +577,7 @@ bool CWalletDB::Recover(CDBEnv& dbenv, std::string filename, bool fOnlyKeys)
// Set -rescan so any missing transactions will be
// found.
int64 now = GetTime();
std::string newFilename = strprintf("wallet.%"PRI64d".bak", now);
std::string newFilename = strprintf("wallet.%" PRI64d ".bak", now);
int result = dbenv.dbenv.dbrename(NULL, filename.c_str(), NULL,
newFilename.c_str(), DB_AUTO_COMMIT);
@@ -600,7 +596,7 @@ bool CWalletDB::Recover(CDBEnv& dbenv, std::string filename, bool fOnlyKeys)
printf("Salvage(aggressive) found no records in %s.\n", newFilename.c_str());
return false;
}
printf("Salvage(aggressive) found %"PRIszu" records\n", salvagedData.size());
printf("Salvage(aggressive) found %" PRIszu " records\n", salvagedData.size());
bool fSuccess = allOK;
Db* pdbCopy = new Db(&dbenv.dbenv, 0);