From 1af1366ff3b26598c1f2adef97be028cfcb0d2e7 Mon Sep 17 00:00:00 2001 From: deusstultus Date: Fri, 5 Dec 2014 09:00:07 -0600 Subject: [PATCH 1/4] Revert 25a07f10 -- makefile.unix STATIC=1 not cleanly implemented --- src/makefile.unix | 1 - 1 file changed, 1 deletion(-) diff --git a/src/makefile.unix b/src/makefile.unix index 913b1472d788..48fcd3117692 100644 --- a/src/makefile.unix +++ b/src/makefile.unix @@ -23,7 +23,6 @@ ifdef UNIT_TEST DEFS+=-DUNIT_TEST=1 endif -STATIC = 1 LMODE = dynamic LMODE2 = dynamic ifdef STATIC From bdbbcaf3d13c5aa5083b2ab6aef267920a7cd746 Mon Sep 17 00:00:00 2001 From: UdjinM6 Date: Sat, 6 Dec 2014 04:48:12 +0300 Subject: [PATCH 2/4] use separate _debug.log with -wallet option --- src/init.cpp | 6 +++++- src/util.cpp | 8 +++++--- src/util.h | 2 ++ 3 files changed, 12 insertions(+), 4 deletions(-) diff --git a/src/init.cpp b/src/init.cpp index 5b9aa76f5622..b19432581d1d 100644 --- a/src/init.cpp +++ b/src/init.cpp @@ -683,7 +683,8 @@ bool AppInit2(boost::thread_group& threadGroup) //ignore masternodes below protocol version nMasternodeMinProtocol = GetArg("-masternodeminprotocol", 0); - std::string strWalletFile = GetArg("-wallet", "wallet.dat"); + //define wallet and debug file + strWalletFile = GetArg("-wallet", "wallet.dat"); // ********************************************************* Step 4: application initialization: dir lock, daemonize, pidfile, debug log @@ -701,6 +702,9 @@ bool AppInit2(boost::thread_group& threadGroup) if (!lock.try_lock()) return InitError(strprintf(_("Cannot obtain a lock on data directory %s. DarkCoin is probably already running."), strDataDir.c_str())); + if(strWalletFile != "wallet.dat") + strDebugFile = boost::filesystem::basename(strWalletFile) + "_debug.log"; + if (GetBoolArg("-shrinkdebugfile", !fDebug)) ShrinkDebugFile(); LogPrintf("\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n"); diff --git a/src/util.cpp b/src/util.cpp index 7c3500b208b7..36fb5025d069 100644 --- a/src/util.cpp +++ b/src/util.cpp @@ -73,6 +73,8 @@ map > mapMultiArgs; bool fMasterNode = false; string strMasterNodePrivKey = ""; string strMasterNodeAddr = ""; +string strWalletFile = "wallet.dat"; +string strDebugFile = "debug.log"; int nInstantXDepth = 1; int nDarksendRounds = 2; int nAnonymizeDarkcoinAmount = 1000; @@ -250,7 +252,7 @@ static void DebugPrintInit() assert(fileout == NULL); assert(mutexDebugLog == NULL); - boost::filesystem::path pathDebug = GetDataDir() / "debug.log"; + boost::filesystem::path pathDebug = GetDataDir() / strDebugFile; fileout = fopen(pathDebug.string().c_str(), "a"); if (fileout) setbuf(fileout, NULL); // unbuffered @@ -287,7 +289,7 @@ int LogPrint(const char* category, const char* pszFormat, ...) // reopen the log file, if requested if (fReopenDebugLog) { fReopenDebugLog = false; - boost::filesystem::path pathDebug = GetDataDir() / "debug.log"; + boost::filesystem::path pathDebug = GetDataDir() / strDebugFile; if (freopen(pathDebug.string().c_str(),"a",fileout) != NULL) setbuf(fileout, NULL); // unbuffered } @@ -1287,7 +1289,7 @@ void AllocateFileRange(FILE *file, unsigned int offset, unsigned int length) { void ShrinkDebugFile() { // Scroll debug.log if it's getting too big - boost::filesystem::path pathLog = GetDataDir() / "debug.log"; + boost::filesystem::path pathLog = GetDataDir() / strDebugFile; FILE* file = fopen(pathLog.string().c_str(), "r"); if (file && GetFilesize(file) > 10 * 1000000) { diff --git a/src/util.h b/src/util.h index 507ade862dfd..4b5a4a492c7f 100644 --- a/src/util.h +++ b/src/util.h @@ -137,6 +137,8 @@ extern int nLiquidityProvider; extern bool fEnableDarksend; extern int64 enforceMasternodePaymentsTime; extern std::string strMasterNodeAddr; +extern std::string strWalletFile; +extern std::string strDebugFile; extern int nMasternodeMinProtocol; extern int keysLoaded; extern bool fSucessfullyLoaded; From c4419878bc5ae099170e953f0fad9eca5b188775 Mon Sep 17 00:00:00 2001 From: UdjinM6 Date: Sat, 6 Dec 2014 04:50:53 +0300 Subject: [PATCH 3/4] use separate _debug.log with -wallet option - fix comments --- src/init.cpp | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/src/init.cpp b/src/init.cpp index b19432581d1d..21c7ee96a3c6 100644 --- a/src/init.cpp +++ b/src/init.cpp @@ -683,7 +683,7 @@ bool AppInit2(boost::thread_group& threadGroup) //ignore masternodes below protocol version nMasternodeMinProtocol = GetArg("-masternodeminprotocol", 0); - //define wallet and debug file + //define wallet strWalletFile = GetArg("-wallet", "wallet.dat"); // ********************************************************* Step 4: application initialization: dir lock, daemonize, pidfile, debug log @@ -702,6 +702,7 @@ bool AppInit2(boost::thread_group& threadGroup) if (!lock.try_lock()) return InitError(strprintf(_("Cannot obtain a lock on data directory %s. DarkCoin is probably already running."), strDataDir.c_str())); + //use _debug.log with -wallet option if(strWalletFile != "wallet.dat") strDebugFile = boost::filesystem::basename(strWalletFile) + "_debug.log"; From 6be18c69506f58fc3fc812403d899137a5ece8d9 Mon Sep 17 00:00:00 2001 From: Evan Duffield Date: Sat, 6 Dec 2014 15:55:05 -0700 Subject: [PATCH 4/4] only update last dseep time when signature is valid --- src/clientversion.h | 2 +- src/masternode.cpp | 4 ++-- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/src/clientversion.h b/src/clientversion.h index d2a237e7a0d9..1a397110eada 100644 --- a/src/clientversion.h +++ b/src/clientversion.h @@ -9,7 +9,7 @@ #define CLIENT_VERSION_MAJOR 0 #define CLIENT_VERSION_MINOR 10 #define CLIENT_VERSION_REVISION 17 -#define CLIENT_VERSION_BUILD 22 +#define CLIENT_VERSION_BUILD 23 // Set to true for release, false for prerelease or test build #define CLIENT_VERSION_IS_RELEASE true diff --git a/src/masternode.cpp b/src/masternode.cpp index 62aff3e47407..c0cc1132ee67 100644 --- a/src/masternode.cpp +++ b/src/masternode.cpp @@ -210,8 +210,6 @@ void ProcessMessageMasternode(CNode* pfrom, std::string& strCommand, CDataStream if(mn.vin.prevout == vin.prevout) { // take this only if it's newer if(mn.lastDseep < sigTime){ - mn.lastDseep = sigTime; - std::string strMessage = mn.addr.ToString() + boost::lexical_cast(sigTime) + boost::lexical_cast(stop); std::string errorMessage = ""; @@ -221,6 +219,8 @@ void ProcessMessageMasternode(CNode* pfrom, std::string& strCommand, CDataStream return; } + mn.lastDseep = sigTime; + if(!mn.UpdatedWithin(MASTERNODE_MIN_DSEEP_SECONDS)){ mn.UpdateLastSeen(); if(stop) {