From 5aab0392622178e655a28ec7220b53b43a61ebdd Mon Sep 17 00:00:00 2001 From: jl777 Date: Tue, 29 Nov 2016 18:16:56 -0300 Subject: [PATCH] test --- src/komodo.h | 2 +- src/miner.cpp | 9 ++++++++- 2 files changed, 9 insertions(+), 2 deletions(-) diff --git a/src/komodo.h b/src/komodo.h index 586d9f3db..30fca14a8 100644 --- a/src/komodo.h +++ b/src/komodo.h @@ -486,7 +486,7 @@ void komodo_connectblock(CBlockIndex *pindex,CBlock& block) hwmheight = pindex->nHeight; else { - printf("hwmheight.%d vs pindex->nHeight.%d t.%u reorg.%d\n",hwmheight,pindex->nHeight,(uint32_t)pindex->nTime,hwmheight-pindex->nHeight); + printf("%s hwmheight.%d vs pindex->nHeight.%d t.%u reorg.%d\n",ASSETCHAINS_SYMBOL,hwmheight,pindex->nHeight,(uint32_t)pindex->nTime,hwmheight-pindex->nHeight); komodo_event_rewind(sp,symbol,pindex->nHeight); komodo_stateupdate(pindex->nHeight,0,0,0,zero,0,0,0,0,-pindex->nHeight,pindex->nTime,0,0,0,0); } diff --git a/src/miner.cpp b/src/miner.cpp index 4db265393..22008131b 100644 --- a/src/miner.cpp +++ b/src/miner.cpp @@ -450,6 +450,7 @@ void IncrementExtraNonce(CBlock* pblock, CBlockIndex* pindexPrev, unsigned int& // // Internal miner // +int8_t komodo_minerid(int32_t height); CBlockTemplate* CreateNewBlockWithKey(CReserveKey& reservekey) { @@ -472,6 +473,12 @@ CBlockTemplate* CreateNewBlockWithKey(CReserveKey& reservekey) script[34] = OP_CHECKSIG; //scriptPubKey = CScript() << ToByteVector(pubkey) << OP_CHECKSIG; } + if ( ASSETCHAINS_SYMBOL[0] == 0 ) + { + for (i=0; i<65; i++) + fprintf(stderr,"%d ",komodo_minerid(activeChain.Tip()->nHeight-i)); + fprintf(stderr," minerids from ht.%d\n",activeChain.Tip()->nHeight); + } return CreateNewBlock(scriptPubKey); } @@ -739,7 +746,7 @@ void static BitcoinMiner(CWallet *pwallet) // Regtest mode doesn't require peers if (vNodes.empty() && chainparams.MiningRequiresPeers()) { - if ( ASSETCHAINS_SYMBOL[0] == 0 || Mining_height >= 100 ) + if ( ASSETCHAINS_SYMBOL[0] == 0 || Mining_height > 100 ) { //fprintf(stderr,"no nodes, break\n"); break;