diff --git a/casinocoin-qt-windows.pro b/casinocoin-qt-windows.pro index ed6de28..6ee3b2c 100644 --- a/casinocoin-qt-windows.pro +++ b/casinocoin-qt-windows.pro @@ -1,6 +1,6 @@ TEMPLATE = app TARGET = casinocoin-qt -VERSION = 2.1.0.0 +VERSION = 3.0.0.0 INCLUDEPATH += src src/json src/qt QT += core gui network widgets qml quick DEFINES += QT_GUI BOOST_THREAD_USE_LIB BOOST_SPIRIT_THREADSAFE USE_IPV6 diff --git a/casinocoin-qt-windows.pro.user b/casinocoin-qt-windows.pro.user index 343f951..eed2bdd 100644 --- a/casinocoin-qt-windows.pro.user +++ b/casinocoin-qt-windows.pro.user @@ -1,6 +1,6 @@ - + EnvironmentId @@ -58,22 +58,21 @@ ProjectExplorer.Project.Target.0 - Desktop Qt 5.5.1 MinGW Static 32bit - Desktop Qt 5.5.1 MinGW Static 32bit - {7d14dbc8-0402-4b0e-98cc-9747e8c52c07} - 1 + Desktop Qt MinGW-w64 32bit (MSYS2) + Desktop Qt MinGW-w64 32bit (MSYS2) + qt.M2_MinGW-w64_i686_kit + 0 0 0 - C:/Users/a.jochems/Documents/GitHub/casinocoin-GUI-2.0 + C:/Users/a.jochems/Documents/GitHub/casinocoin-issue-18 true qmake QtProjectManager.QMakeBuildStep - false - false + true USE_UPNP=0 USE_QRCODE=1 USE_IPV6=1 false false @@ -116,11 +115,11 @@ Debug Qt4ProjectManager.Qt4BuildConfiguration - 2 + 0 true - C:/Users/a.jochems/Documents/GitHub/casinocoin-issue-13 + C:/Users/a.jochems/Documents/GitHub/build-casinocoin-qt-windows-Desktop_Qt_MinGW_w64_32bit_MSYS2-Release true @@ -128,8 +127,7 @@ QtProjectManager.QMakeBuildStep false - false - USE_UPNP=0 USE_QRCODE=1 USE_IPV6=1 + false false false @@ -174,7 +172,61 @@ 0 true - 2 + + C:/Users/a.jochems/Documents/GitHub/build-casinocoin-qt-windows-Desktop_Qt_MinGW_w64_32bit_MSYS2-Profile + + + true + qmake + + QtProjectManager.QMakeBuildStep + true + + false + true + false + + + true + Make + + Qt4ProjectManager.MakeStep + + false + + + + 2 + Build + + ProjectExplorer.BuildSteps.Build + + + + true + Make + + Qt4ProjectManager.MakeStep + + true + clean + + + 1 + Clean + + ProjectExplorer.BuildSteps.Clean + + 2 + false + + Profile + + Qt4ProjectManager.Qt4BuildConfiguration + 0 + true + + 3 0 @@ -190,6 +242,10 @@ 1 + false + 1000 + + true false false @@ -227,8 +283,9 @@ 2 casinocoin-qt-windows - casinocoin-qt-windows2 - Qt4ProjectManager.Qt4RunConfiguration:C:/Users/a.jochems/Documents/GitHub/casinocoin-issue-13/casinocoin-qt-windows.pro + + Qt4ProjectManager.Qt4RunConfiguration:C:/Users/a.jochems/Documents/GitHub/casinocoin-issue-18/casinocoin-qt-windows.pro + true casinocoin-qt-windows.pro false diff --git a/src/clientversion.h b/src/clientversion.h index 2fcb134..4974d4b 100644 --- a/src/clientversion.h +++ b/src/clientversion.h @@ -6,8 +6,8 @@ // // These need to be macros, as version.cpp's and bitcoin-qt.rc's voodoo requires it -#define CLIENT_VERSION_MAJOR 2 -#define CLIENT_VERSION_MINOR 1 +#define CLIENT_VERSION_MAJOR 3 +#define CLIENT_VERSION_MINOR 0 #define CLIENT_VERSION_REVISION 0 #define CLIENT_VERSION_BUILD 0 @@ -16,7 +16,7 @@ // Copyright year (2009-this) // Todo: update this when changing our copyright comments in the source -#define COPYRIGHT_YEAR 2015 +#define COPYRIGHT_YEAR 2016 // Converts the parameter X to a string after macro replacement on X has been performed. // Don't merge these into one macro! diff --git a/src/main.cpp b/src/main.cpp index 2fdcc59..ae1a002 100644 --- a/src/main.cpp +++ b/src/main.cpp @@ -1109,18 +1109,24 @@ int64 static GetBlockValue(int nHeight, int64 nFees) } // Permantently reduce the number of mined coins to 10 after block 575000 + // Permantently reduce the number of minded coins to 1 after block 1750000 + // coin supply at that height = 40327215 + // Blocks until max coin supply -> 63000000 - 40327215 = 22672785 + // New height for reduction to 0 coins -> 1750000 + 22672785 = 24422785 if(nHeight > 575000){ - if(nHeight < 3756000){ - nSubsidy = 10 * COIN; + if(nHeight < 1750000) + { + nSubsidy = 10 * COIN; + } + else if(nHeight >= 1750000 && nHeight <= 24422785){ + nSubsidy = 1 * COIN; } else { nSubsidy = 0 * COIN; } } - - - + // return subsidy + fees return nSubsidy + nFees; } @@ -3494,6 +3500,26 @@ void static ProcessGetData(CNode* pfrom) } } +bool static CheckValidClientVersion(int clientVersion) +{ + // From block 1750000 onwards version must be 80001 (MIN_PEER_PROTO_VERSION) + // Before that version was 70004 + if(pindexBest->nHeight >= 1750000) + { + if(clientVersion < MIN_PEER_PROTO_VERSION) + return false; + else + return true; + } + else + { + if(clientVersion < 70004) + return false; + else + return true; + } +} + bool static ProcessMessage(CNode* pfrom, string strCommand, CDataStream& vRecv) { RandAddSeedPerfmon(); @@ -3505,10 +3531,6 @@ bool static ProcessMessage(CNode* pfrom, string strCommand, CDataStream& vRecv) return true; } - - - - if (strCommand == "version") { // Each connection can only send one version message @@ -3523,7 +3545,8 @@ bool static ProcessMessage(CNode* pfrom, string strCommand, CDataStream& vRecv) CAddress addrFrom; uint64 nNonce = 1; vRecv >> pfrom->nVersion >> pfrom->nServices >> nTime >> addrMe; - if (pfrom->nVersion < MIN_PEER_PROTO_VERSION) + // Check version related to blockheight + if(!CheckValidClientVersion(pfrom->nVersion)) { // disconnect from peers older than this proto version printf("partner %s using obsolete version %i; disconnecting\n", pfrom->addr.ToString().c_str(), pfrom->nVersion); diff --git a/src/version.h b/src/version.h index e820978..15de020 100644 --- a/src/version.h +++ b/src/version.h @@ -29,13 +29,13 @@ static const std::string COIN_NAME_DISPLAY("CasinoCoin"); // network protocol versioning // -static const int PROTOCOL_VERSION = 70004; +static const int PROTOCOL_VERSION = 80001; // intial proto version, to be increased after version/verack negotiation static const int INIT_PROTO_VERSION = 209; // disconnect from peers older than this proto version -static const int MIN_PEER_PROTO_VERSION = 70004; // TODO: Change to 70004 before block 445000 to force new client downloading and therefore doing the actual hard fork +static const int MIN_PEER_PROTO_VERSION = 80001; // TODO: Change to 70004 before block 445000 to force new client downloading and therefore doing the actual hard fork // nTime field added to CAddress, starting with this version; // if possible, avoid requesting addresses nodes older than this