From 1fa3de387cf62f257fa28e609751630ee80cfbc5 Mon Sep 17 00:00:00 2001 From: Duke Leto Date: Wed, 11 Dec 2019 16:31:28 -0500 Subject: [PATCH] Delete delete delete --- src/main.cpp | 5 ++- src/rpc/blockchain.cpp | 74 ------------------------------------------ 2 files changed, 2 insertions(+), 77 deletions(-) diff --git a/src/main.cpp b/src/main.cpp index e9bc4c561..cfd8e1c7d 100644 --- a/src/main.cpp +++ b/src/main.cpp @@ -48,7 +48,6 @@ #include "validationinterface.h" #include "wallet/asyncrpcoperation_sendmany.h" #include "wallet/asyncrpcoperation_shieldcoinbase.h" -#include "notaries_staked.h" #include #include @@ -3489,7 +3488,7 @@ bool ConnectBlock(const CBlock& block, CValidationState& state, CBlockIndex* pin CAmount nFees = 0; int nInputs = 0; uint64_t valueout; - int64_t voutsum = 0, prevsum = 0, interest, sum = 0, stakeTxValue = 0; + int64_t voutsum = 0, prevsum = 0, interest, sum = 0; unsigned int nSigOps = 0; CDiskTxPos pos(pindex->GetBlockPos(), GetSizeOfCompactSize(block.vtx.size())); std::vector > vPos; @@ -5052,7 +5051,7 @@ bool CheckBlockHeader(int32_t *futureblockp,int32_t height,CBlockIndex *pindex, } int32_t komodo_check_deposit(int32_t height,const CBlock& block,uint32_t prevtime); -int32_t komodo_checkPOW(int64_t stakeTxValue,int32_t slowflag,CBlock *pblock,int32_t height); +int32_t komodo_checkPOW(int32_t slowflag,CBlock *pblock,int32_t height); bool CheckBlock(int32_t *futureblockp,int32_t height,CBlockIndex *pindex,const CBlock& block, CValidationState& state, libzcash::ProofVerifier& verifier, diff --git a/src/rpc/blockchain.cpp b/src/rpc/blockchain.cpp index 688695956..8b65b8249 100644 --- a/src/rpc/blockchain.cpp +++ b/src/rpc/blockchain.cpp @@ -648,80 +648,10 @@ UniValue getblockhash(const UniValue& params, bool fHelp) UniValue getlastsegidstakes(const UniValue& params, bool fHelp) { - if (fHelp || params.size() != 1) - throw runtime_error( - "getlastsegidstakes depth\n" - "\nReturns object containing the counts of the last X blocks staked by each segid.\n" - "\nArguments:\n" - "1. depth (numeric, required) The amount of blocks to scan back." - "\nResult:\n" - "{\n" - " \"0\" : n, (numeric) number of stakes from segid 0 in the last X blocks.\n" - " .....\n" - "}\n" - "\nExamples:\n" - + HelpExampleCli("getlastsegidstakes", "1000") - + HelpExampleRpc("getlastsegidstakes", "1000") - ); - - if ( ASSETCHAINS_STAKED == 0 ) - throw runtime_error("Only applies to ac_staked chains\n"); - - LOCK(cs_main); - - int depth = params[0].get_int(); - if ( depth > chainActive.Height() ) - throw runtime_error("Not enough blocks to scan back that far.\n"); - - int32_t segids[64] = {0}; - int32_t pow = 0; - int32_t notset = 0; - - for (int64_t i = chainActive.Height(); i > chainActive.Height()-depth; i--) - { - int8_t segid = komodo_segid(0,i); - //CBlockIndex* pblockindex = chainActive[i]; - if ( segid >= 0 ) - segids[segid] += 1; - else if ( segid == -1 ) - pow++; - else - notset++; - } - - int8_t posperc = 100*(depth-pow)/depth; - UniValue ret(UniValue::VOBJ); - UniValue objsegids(UniValue::VOBJ); - for (int8_t i = 0; i < 64; i++) - { - char str[4]; - sprintf(str, "%d", i); - objsegids.push_back(Pair(str,segids[i])); - } - ret.push_back(Pair("NotSet",notset)); - ret.push_back(Pair("PoW",pow)); - ret.push_back(Pair("PoSPerc",posperc)); - ret.push_back(Pair("SegIds",objsegids)); return ret; } -/*uint256 _komodo_getblockhash(int32_t nHeight) -{ - uint256 hash; - LOCK(cs_main); - if ( nHeight >= 0 && nHeight <= chainActive.Height() ) - { - CBlockIndex* pblockindex = chainActive[nHeight]; - hash = pblockindex->GetBlockHash(); - int32_t i; - for (i=0; i<32; i++) - printf("%02x",((uint8_t *)&hash)[i]); - printf(" blockhash.%d\n",nHeight); - } else memset(&hash,0,sizeof(hash)); - return(hash); -}*/ - UniValue getblockheader(const UniValue& params, bool fHelp) { if (fHelp || params.size() < 1 || params.size() > 2) @@ -1735,10 +1665,6 @@ UniValue getblockchaininfo(const UniValue& params, bool fHelp) obj.push_back(Pair("difficulty", (double)GetNetworkDifficulty())); obj.push_back(Pair("verificationprogress", progress)); obj.push_back(Pair("chainwork", chainActive.LastTip()->chainPower.chainWork.GetHex())); - if (ASSETCHAINS_LWMAPOS) - { - obj.push_back(Pair("chainstake", chainActive.LastTip()->chainPower.chainStake.GetHex())); - } obj.push_back(Pair("pruned", fPruneMode)); SproutMerkleTree tree;