From 9b2da32c6d25f8cf09e466d1b7f3a2ca281bc788 Mon Sep 17 00:00:00 2001 From: Evan Duffield Date: Thu, 15 May 2014 06:05:11 -0700 Subject: [PATCH] every architecture should work now (DGW3), checkpoints and reduced masternode chatter --- src/checkpoints.cpp | 4 +++- src/clientversion.h | 2 +- src/main.cpp | 41 +++++++++++------------------------------ src/main.h | 2 +- src/net.cpp | 3 +++ 5 files changed, 19 insertions(+), 33 deletions(-) diff --git a/src/checkpoints.cpp b/src/checkpoints.cpp index 214f29fbae..bec3b985a6 100644 --- a/src/checkpoints.cpp +++ b/src/checkpoints.cpp @@ -42,10 +42,12 @@ namespace Checkpoints ( 23912, uint256("0x0000000000335eac6703f3b1732ec8b2f89c3ba3a7889e5767b090556bb9a276")) ( 35457, uint256("0x0000000000b0ae211be59b048df14820475ad0dd53b9ff83b010f71a77342d9f")) ( 45479, uint256("0x000000000063d411655d590590e16960f15ceea4257122ac430c6fbe39fbf02d")) + ( 55895, uint256("0x0000000000ae4c53a43639a4ca027282f69da9c67ba951768a20415b6439a2d7")) + ( 68899, uint256("0x0000000000194ab4d3d9eeb1f2f792f21bb39ff767cb547fe977640f969d77b7")) ; static const CCheckpointData data = { &mapCheckpoints, - 1393373461, // * UNIX timestamp of last checkpoint block + 1400148293, // * UNIX timestamp of last checkpoint block 25000, // * total number of transactions between genesis and last checkpoint // (the tx=... number in the SetBestChain debug.log lines) 800.0 // * estimated number of transactions per day after checkpoint diff --git a/src/clientversion.h b/src/clientversion.h index 3e06daca0f..664232d4d9 100644 --- a/src/clientversion.h +++ b/src/clientversion.h @@ -9,7 +9,7 @@ #define CLIENT_VERSION_MAJOR 0 #define CLIENT_VERSION_MINOR 9 #define CLIENT_VERSION_REVISION 3 -#define CLIENT_VERSION_BUILD 3 +#define CLIENT_VERSION_BUILD 4 // Set to true for release, false for prerelease or test build #define CLIENT_VERSION_IS_RELEASE true diff --git a/src/main.cpp b/src/main.cpp index e27697f2bb..0e69b8d0cb 100644 --- a/src/main.cpp +++ b/src/main.cpp @@ -2720,37 +2720,18 @@ bool CBlock::AcceptBlock(CValidationState &state, CDiskBlockPos *dbp) if (nBits != GetNextWorkRequired(pindexPrev, this)) return state.DoS(100, error("AcceptBlock() : incorrect proof of work")); } else { - #ifdef _WIN32 - // Check proof of work - if(nHeight >= 34140){ - unsigned int nBitsNext = GetNextWorkRequired(pindexPrev, this); - double n1 = ConvertBitsToDouble(nBits); - double n2 = ConvertBitsToDouble(nBitsNext); + // Check proof of work (Here for the architecture issues with DGW v1 and v2) + if(nHeight <= 68589){ + unsigned int nBitsNext = GetNextWorkRequired(pindexPrev, this); + double n1 = ConvertBitsToDouble(nBits); + double n2 = ConvertBitsToDouble(nBitsNext); - if (nHeight <= 45000) { - if (abs(n1-n2) > n1*0.2) - return state.DoS(100, error("AcceptBlock() : incorrect proof of work (DGW pre-fork)")); - } else { - if (abs(n1-n2) > n1*0.005) - return state.DoS(100, error("AcceptBlock() : incorrect proof of work (DGW2)")); - } - } else { - if (nBits != GetNextWorkRequired(pindexPrev, this)) - return state.DoS(100, error("AcceptBlock() : incorrect proof of work")); - } - #else - // Check proof of work - if(nHeight >= 34140 && nHeight <= 45000){ - unsigned int nBitsNext = GetNextWorkRequired(pindexPrev, this); - double n1 = ConvertBitsToDouble(nBits); - double n2 = ConvertBitsToDouble(nBitsNext); - if (abs(n1-n2) > n1*0.2) - return state.DoS(100, error("AcceptBlock() : incorrect proof of work (DGW pre-fork)")); - } else { - if (nBits != GetNextWorkRequired(pindexPrev, this)) - return state.DoS(100, error("AcceptBlock() : incorrect proof of work")); - } - #endif + if (abs(n1-n2) > n1*0.2) + return state.DoS(100, error("AcceptBlock() : incorrect proof of work (DGW pre-fork)")); + } else { + if (nBits != GetNextWorkRequired(pindexPrev, this)) + return state.DoS(100, error("AcceptBlock() : incorrect proof of work")); + } } // Prevent blocks from too far in the future diff --git a/src/main.h b/src/main.h index c9789a9722..5ca163648e 100644 --- a/src/main.h +++ b/src/main.h @@ -2440,7 +2440,7 @@ public: bool UpdatedWithin(int milliSeconds) { - printf("UpdatedWithin %"PRI64u"\n", GetTimeMillis() - lastTimeSeen); + //printf("UpdatedWithin %"PRI64u"\n", GetTimeMillis() - lastTimeSeen); return GetTimeMillis() - lastTimeSeen < milliSeconds; } diff --git a/src/net.cpp b/src/net.cpp index e9db8de8e4..ed81ddda69 100644 --- a/src/net.cpp +++ b/src/net.cpp @@ -1913,9 +1913,12 @@ void RelayTransaction(const CTransaction& tx, const uint256& hash, const CDataSt void RelayDarkSendElectionEntry(const CTxIn vin, const CService addr, const std::vector vchSig, const int64 nNow, const CPubKey pubkey, const int count, const int current) { + int c = 0; LOCK(cs_vNodes); BOOST_FOREACH(CNode* pnode, vNodes) { + c++; + if(c > 4) break; pnode->PushMessage("dsee", vin, addr, vchSig, nNow, pubkey, count, current); } }