From f1e6bb019082a3d7969c75eff68b76e94514d7de Mon Sep 17 00:00:00 2001 From: jl777 Date: Mon, 7 Nov 2016 21:07:13 -0300 Subject: [PATCH] test --- src/komodo_gateway.h | 20 ++++++++++---------- src/miner.cpp | 2 +- 2 files changed, 11 insertions(+), 11 deletions(-) diff --git a/src/komodo_gateway.h b/src/komodo_gateway.h index 2afa3281e..3279cfd95 100644 --- a/src/komodo_gateway.h +++ b/src/komodo_gateway.h @@ -88,9 +88,9 @@ struct pax_transaction *komodo_paxmark(int32_t height,struct pax_transaction *sp if ( pax != 0 ) { pax->marked = mark; - int32_t i; for (i=0; i<32; i++) - printf("%02x",((uint8_t *)&txid)[i]); - printf(" paxmark.ht %d vout%d\n",mark,vout); + //int32_t i; for (i=0; i<32; i++) + // printf("%02x",((uint8_t *)&txid)[i]); + //printf(" paxmark.ht %d vout%d\n",mark,vout); memcpy(space,pax,sizeof(*pax)); } pthread_mutex_unlock(&komodo_mutex); @@ -108,9 +108,9 @@ void komodo_gateway_deposit(char *coinaddr,uint64_t value,int32_t shortflag,char pax->txid = txid; pax->vout = vout; HASH_ADD_KEYPTR(hh,PAX,&pax->txid,sizeof(pax->txid),pax); - int32_t i; for (i=0; i<32; i++) - printf("%02x",((uint8_t *)&txid)[i]); - printf(" v.%d [%s] ht.%d create pax.%p\n",vout,ASSETCHAINS_SYMBOL,height,pax); + //int32_t i; for (i=0; i<32; i++) + // printf("%02x",((uint8_t *)&txid)[i]); + //printf(" v.%d [%s] ht.%d create pax.%p\n",vout,ASSETCHAINS_SYMBOL,height,pax); } pthread_mutex_unlock(&komodo_mutex); if ( coinaddr != 0 ) @@ -250,9 +250,9 @@ int32_t komodo_check_deposit(int32_t height,const CBlock& block) // verify above else { hash = block.GetHash(); - for (j=0; j<32; j++) - printf("%02x",((uint8_t *)&hash)[j]); - printf(" ht.%d blockhash couldnt find vout.[%d]\n",height,i); + //for (j=0; j<32; j++) + // printf("%02x",((uint8_t *)&hash)[j]); + //printf(" ht.%d blockhash couldnt find vout.[%d]\n",height,i); } } else @@ -265,7 +265,7 @@ int32_t komodo_check_deposit(int32_t height,const CBlock& block) // verify above } if ( matched != num ) { - printf("matched.%d vs num.%d\n",matched,num); + //printf("matched.%d vs num.%d\n",matched,num); if ( height > 60000 ) return(-1); } diff --git a/src/miner.cpp b/src/miner.cpp index 0514238c8..45cfdef45 100644 --- a/src/miner.cpp +++ b/src/miner.cpp @@ -116,7 +116,7 @@ CBlockTemplate* CreateNewBlock(const CScript& scriptPubKeyIn) CBlock *pblock = &pblocktemplate->block; // pointer for convenience if ( ASSETCHAINS_SYMBOL[0] != 0 ) fprintf(stderr,"start CreateNewBlock %s initdone.%d deposit %.8f mempool.%d RT.%u\n",ASSETCHAINS_SYMBOL,KOMODO_INITDONE,(double)komodo_paxtotal()/COIN,(int32_t)mempool.GetTotalTxSize(),KOMODO_REALTIME); - while ( chainActive.Tip()->nHeight > ASSETCHAINS_MINHEIGHT && mempool.GetTotalTxSize() <= 0 ) + while ( chainActive.Tip() == 0 || chainActive.Tip()->nHeight < ASSETCHAINS_MINHEIGHT || mempool.GetTotalTxSize() <= 0 ) { deposits = komodo_paxtotal(); if ( KOMODO_INITDONE == 0 || time(NULL) < KOMODO_INITDONE+60 || KOMODO_REALTIME == 0 )