From b9779b671c58466c299bb7df5bb1eb83edbd2a91 Mon Sep 17 00:00:00 2001 From: blackjok3r Date: Wed, 6 Feb 2019 13:31:02 +0800 Subject: [PATCH] add LABST2 to block reward chains. Add exeption to verushash staker to increase staking diff in first 50 bocks. --- src/komodo_bitcoind.h | 2 +- src/notaries_staked.cpp | 14 +++++++------- src/notaries_staked.h | 3 +-- 3 files changed, 9 insertions(+), 10 deletions(-) diff --git a/src/komodo_bitcoind.h b/src/komodo_bitcoind.h index 0a72903da..a40a174b1 100644 --- a/src/komodo_bitcoind.h +++ b/src/komodo_bitcoind.h @@ -1437,7 +1437,7 @@ uint32_t komodo_stake(int32_t validateflag,arith_uint256 bnTarget,int32_t nHeigh { // Under PoS % target and we need to increase diff. //fprintf(stderr, "PoS too low diff.%i changed to.",diff); - diff = diff * ( (ASSETCHAINS_STAKED - PoSperc + 1) * (ASSETCHAINS_STAKED - PoSperc + 1) ); + diff = diff * ( (ASSETCHAINS_STAKED - PoSperc + 1) * (ASSETCHAINS_STAKED - PoSperc + 1) * ( nHeight < 50 ? 1000 : 1)); //fprintf(stderr, "%i \n",diff); } else if ( PoSperc > ASSETCHAINS_STAKED ) diff --git a/src/notaries_staked.cpp b/src/notaries_staked.cpp index cdaffa7a2..6e6912256 100644 --- a/src/notaries_staked.cpp +++ b/src/notaries_staked.cpp @@ -17,16 +17,16 @@ int8_t is_STAKED(const char *chain_name) return(0); if (doneinit == 1 && ASSETCHAINS_SYMBOL[0] != 0) return(STAKED); - if ( (strcmp(chain_name, "LABS") == 0) || (strcmp(chain_name, "PAYME") == 0) || (strcmp(chain_name, "LABST") == 0) ) - STAKED = 1; - else if ( (strncmp(chain_name, "LABS", 4) == 0) ) - STAKED = 2; + if ( (strcmp(chain_name, "LABS") == 0) || (strcmp(chain_name, "LABST2") == 0) ) + STAKED = 1; // These chains are allowed coin emissions. + else if ( (strncmp(chain_name, "LABS", 4) == 0) ) + STAKED = 2; // These chains have no coin emission, block subsidy is always 0, and comission is 0. Notary pay is allowed. else if ( (strcmp(chain_name, "CFEK") == 0) || (strncmp(chain_name, "CFEK", 4) == 0) ) - STAKED = 3; + STAKED = 3; // These chains have no speical rules at all. else if ( (strcmp(chain_name, "TEST") == 0) || (strncmp(chain_name, "TEST", 4) == 0) ) - STAKED = 4; + STAKED = 4; // These chains are for testing consensus to create a chain etc. Not meant ot be actually used for anything important. else if ( (strcmp(chain_name, "THIS_CHAIN_IS_BANNED") == 0) ) - STAKED = 255; // This means that all notarisations for chains that are in 255 group are invalid. + STAKED = 255; // Any chain added to this group is banned, no notarisations are valid, as a consensus rule. Can be used to remove a chain from cluster if needed. doneinit = 1; return(STAKED); }; diff --git a/src/notaries_staked.h b/src/notaries_staked.h index 468b7b7ca..ed195bf48 100644 --- a/src/notaries_staked.h +++ b/src/notaries_staked.h @@ -24,6 +24,7 @@ static const int STAKED_ERA_GAP = 777; static const int NUM_STAKED_ERAS = 4; static const int STAKED_NOTARIES_TIMESTAMP[NUM_STAKED_ERAS] = {1542964044, 1549188000, 1604233333, 1604244444}; +static const int32_t num_notaries_STAKED[NUM_STAKED_ERAS] = { 17, 25, 19, 17 }; // Era array of pubkeys. static const char *notaries_STAKED[NUM_STAKED_ERAS][64][2] = @@ -116,8 +117,6 @@ static const char *notaries_STAKED[NUM_STAKED_ERAS][64][2] = } }; -static const int32_t num_notaries_STAKED[NUM_STAKED_ERAS] = { 17, 25, 19, 17 }; - int8_t is_STAKED(const char *chain_name); int32_t STAKED_era(int timestamp); int8_t updateStakedNotary();