diff --git a/src/miner.cpp b/src/miner.cpp index 093c2295d..190f01d55 100644 --- a/src/miner.cpp +++ b/src/miner.cpp @@ -113,11 +113,11 @@ extern uint8_t NOTARY_PUBKEY33[33],ASSETCHAINS_OVERRIDE_PUBKEY33[33]; uint32_t Mining_start,Mining_height; int32_t komodo_chosennotary(int32_t *notaryidp,int32_t height,uint8_t *pubkey33,uint32_t timestamp); int32_t komodo_pax_opreturn(int32_t height,uint8_t *opret,int32_t maxsize); -uint64_t komodo_paxtotal(); +//uint64_t komodo_paxtotal(); int32_t komodo_baseid(char *origbase); int32_t komodo_is_issuer(); int32_t komodo_gateway_deposits(CMutableTransaction *txNew,char *symbol,int32_t tokomodo); -int32_t komodo_isrealtime(int32_t *kmdheightp); +//int32_t komodo_isrealtime(int32_t *kmdheightp); int32_t komodo_validate_interest(const CTransaction &tx,int32_t txheight,uint32_t nTime,int32_t dispflag); uint64_t komodo_commission(const CBlock *block); int32_t komodo_staked(CMutableTransaction &txNew,uint32_t nBits,uint32_t *blocktimep,uint32_t *txtimep,uint256 *utxotxidp,int32_t *utxovoutp,uint64_t *utxovaluep,uint8_t *utxosig); @@ -133,7 +133,7 @@ CBlockTemplate* CreateNewBlock(const CScript& scriptPubKeyIn) return NULL; } CBlock *pblock = &pblocktemplate->block; // pointer for convenience - if ( ASSETCHAINS_SYMBOL[0] != 0 && komodo_baseid(ASSETCHAINS_SYMBOL) >= 0 && chainActive.Tip()->nHeight >= ASSETCHAINS_MINHEIGHT ) + /*if ( ASSETCHAINS_SYMBOL[0] != 0 && komodo_baseid(ASSETCHAINS_SYMBOL) >= 0 && chainActive.Tip()->nHeight >= ASSETCHAINS_MINHEIGHT ) { isrealtime = komodo_isrealtime(&kmdheight); deposits = komodo_paxtotal(); @@ -154,7 +154,7 @@ CBlockTemplate* CreateNewBlock(const CScript& scriptPubKeyIn) KOMODO_ON_DEMAND = 0; if ( 0 && deposits != 0 ) printf("miner KOMODO_DEPOSIT %llu pblock->nHeight %d mempool.GetTotalTxSize(%d)\n",(long long)komodo_paxtotal(),(int32_t)chainActive.Tip()->nHeight,(int32_t)mempool.GetTotalTxSize()); - } + }*/ // -regtest only: allow overriding block.nVersion with // -blockversion=N to test forking scenarios if (Params().MineBlocksOnDemand()) diff --git a/src/rpcmisc.cpp b/src/rpcmisc.cpp index b4e63b9b0..33a947b8c 100644 --- a/src/rpcmisc.cpp +++ b/src/rpcmisc.cpp @@ -88,13 +88,13 @@ UniValue getinfo(const UniValue& params, bool fHelp) + HelpExampleCli("getinfo", "") + HelpExampleRpc("getinfo", "") ); - fprintf(stderr,"before LOCK cs_main\n"); + //fprintf(stderr,"before LOCK cs_main\n"); #ifdef ENABLE_WALLET LOCK2(cs_main, pwalletMain ? &pwalletMain->cs_wallet : NULL); #else LOCK(cs_main); #endif - fprintf(stderr,"after LOCK cs_main\n"); + //fprintf(stderr,"after LOCK cs_main\n"); proxyType proxy; GetProxy(NET_IPV4, proxy); @@ -125,7 +125,7 @@ UniValue getinfo(const UniValue& params, bool fHelp) obj.push_back(Pair("blocks", (int)chainActive.Height())); if ( (longestchain= komodo_longestchain()) != 0 && chainActive.Height() > longestchain ) longestchain = chainActive.Height(); - fprintf(stderr,"after longestchain\n"); + //fprintf(stderr,"after longestchain\n"); obj.push_back(Pair("longestchain", longestchain)); obj.push_back(Pair("timeoffset", GetTimeOffset())); if ( chainActive.Tip() != 0 ) diff --git a/src/rpcnet.cpp b/src/rpcnet.cpp index 1d492f35a..3ef614815 100644 --- a/src/rpcnet.cpp +++ b/src/rpcnet.cpp @@ -169,9 +169,11 @@ int32_t KOMODO_LONGESTCHAIN; int32_t komodo_longestchain() { int32_t ht,n=0,num=0,maxheight=0,height = 0; - LOCK(cs_main); - vector vstats; - CopyNodeStats(vstats); + { + LOCK(cs_main); + vector vstats; + CopyNodeStats(vstats); + } BOOST_FOREACH(const CNodeStats& stats, vstats) { //fprintf(stderr,"komodo_longestchain iter.%d\n",n);