Delete delete delete
This commit is contained in:
@@ -48,7 +48,6 @@
|
||||
#include "validationinterface.h"
|
||||
#include "wallet/asyncrpcoperation_sendmany.h"
|
||||
#include "wallet/asyncrpcoperation_shieldcoinbase.h"
|
||||
#include "notaries_staked.h"
|
||||
|
||||
#include <cstring>
|
||||
#include <algorithm>
|
||||
@@ -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<std::pair<uint256, CDiskTxPos> > 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,
|
||||
|
||||
@@ -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;
|
||||
|
||||
Reference in New Issue
Block a user