From cdf4c90c6d2db1567c74eda1b1d198329315a62c Mon Sep 17 00:00:00 2001 From: Duke Leto Date: Fri, 20 Dec 2019 15:26:04 -0500 Subject: [PATCH] Update setgenerate, getgenerate, getblocktemplate RPCs to remove staking code --- src/komodo_notary.h | 4 ++-- src/rpc/mining.cpp | 31 ++++++------------------------- 2 files changed, 8 insertions(+), 27 deletions(-) diff --git a/src/komodo_notary.h b/src/komodo_notary.h index 6c819c005..78732826a 100644 --- a/src/komodo_notary.h +++ b/src/komodo_notary.h @@ -109,7 +109,7 @@ int32_t komodo_notaries(uint8_t pubkeys[64][33],int32_t height,uint32_t timestam } else { - // This is a non LABS assetchain, use timestamp to detemine notary pubkeys. + // Use timestamp to detemine notary pubkeys. kmd_season = getacseason(timestamp); } if ( kmd_season != 0 ) @@ -120,7 +120,7 @@ int32_t komodo_notaries(uint8_t pubkeys[64][33],int32_t height,uint32_t timestam decode_hex(kmd_pubkeys[kmd_season-1][i],33,(char *)notaries_elected[kmd_season-1][i][1]); if ( ASSETCHAINS_PRIVATE != 0 ) { - // this is PIRATE, we need to populate the address array for the notary exemptions. + // we need to populate the address array for the notary exemptions. for (i = 0; i 2) throw runtime_error( "setgenerate generate ( genproclimit )\n" - "\nSet 'generate' true to turn either mining/generation or minting/staking on and false to turn both off.\n" - "Mining is limited to 'genproclimit' processors, -1 is unlimited, setgenerate true with 0 genproclimit turns on staking\n" + "\nSet 'generate' true to turn mining/generation on or false turn both off.\n" + "Mining is limited to 'genproclimit' processors, -1 is unlimited\n" "See the getgenerate call for the current setting.\n" "\nArguments:\n" "1. generate (boolean, required) Set to true to turn on generation, off to turn off.\n" - "2. genproclimit (numeric, optional) Set processor limit when generation is on. Can be -1 for unlimited, 0 to turn on staking.\n" + "2. genproclimit (numeric, optional) Set processor limit when generation is on. Can be -1 for unlimited.\n" "\nExamples:\n" "\nSet the generation on with a limit of one processor\n" + HelpExampleCli("setgenerate", "true 1") + - "\nTurn minting/staking on\n" - + HelpExampleCli("setgenerate", "true 0") + "\nCheck the setting\n" + HelpExampleCli("getgenerate", "") + - "\nTurn off generation and minting\n" - + HelpExampleCli("setgenerate", "false") + "\nUsing json rpc\n" + HelpExampleRpc("setgenerate", "true, 1") ); @@ -484,8 +475,6 @@ UniValue getmininginfo(const UniValue& params, bool fHelp, const CPubKey& mypk) obj.push_back(Pair("testnet", Params().TestnetToBeDeprecatedFieldRPC())); obj.push_back(Pair("chain", Params().NetworkIDString())); #ifdef ENABLE_MINING - bool staking = false; - obj.push_back(Pair("staking", staking)); obj.push_back(Pair("generate", GetBoolArg("-gen", false) && GetBoolArg("-genproclimit", -1) != 0 )); obj.push_back(Pair("numthreads", (int64_t)KOMODO_MININGTHREADS)); #endif @@ -857,15 +846,7 @@ UniValue getblocktemplate(const UniValue& params, bool fHelp, const CPubKey& myp // result.push_back(Pair("coinbasevalue", (int64_t)pblock->vtx[0].vout[0].nValue)); //} result.push_back(Pair("longpollid", chainActive.LastTip()->GetBlockHash().GetHex() + i64tostr(nTransactionsUpdatedLast))); - if ( ASSETCHAINS_STAKED != 0 ) - { - arith_uint256 POWtarget; int32_t PoSperc; - POWtarget = komodo_PoWtarget(&PoSperc,hashTarget,(int32_t)(pindexPrev->GetHeight()+1),ASSETCHAINS_STAKED); - result.push_back(Pair("target", POWtarget.GetHex())); - result.push_back(Pair("PoSperc", (int64_t)PoSperc)); - result.push_back(Pair("ac_staked", (int64_t)ASSETCHAINS_STAKED)); - result.push_back(Pair("origtarget", hashTarget.GetHex())); - } + /*else if ( ASSETCHAINS_ADAPTIVEPOW > 0 ) result.push_back(Pair("target",komodo_adaptivepow_target((int32_t)(pindexPrev->GetHeight()+1),hashTarget,pblock->nTime).GetHex()));*/ else