From 27b641d8156753f087376ebb497622ed23976f48 Mon Sep 17 00:00:00 2001 From: jl777 Date: Sat, 2 Apr 2016 11:11:31 -0600 Subject: [PATCH] test --- iguana/iguana_unspents.c | 7 ++++--- iguana/main.c | 4 ++-- 2 files changed, 6 insertions(+), 5 deletions(-) diff --git a/iguana/iguana_unspents.c b/iguana/iguana_unspents.c index b8dc1969d..9e697eaf1 100755 --- a/iguana/iguana_unspents.c +++ b/iguana/iguana_unspents.c @@ -1314,6 +1314,7 @@ void *iguana_ramchainfile(struct iguana_info *coin,struct iguana_ramchain *dest, int32_t iguana_realtime_update(struct iguana_info *coin) { + double startmillis0; static double totalmillis0; static int32_t num0; struct iguana_bundle *bp; struct iguana_ramchaindata *rdata; int32_t bundlei,n,flag=0; struct iguana_block *block=0; struct iguana_blockRO *B; struct iguana_ramchain *dest=0,blockR; if ( (bp= coin->current) != 0 && time(NULL) > bp->lastRT && bp->hdrsi == coin->longestchain/coin->chain->bundlesize && bp->hdrsi == coin->balanceswritten && coin->RTheight >= bp->bundleheight && coin->RTheight < bp->bundleheight+bp->n )//&& coin->blocks.hwmchain.height >= coin->longestchain-1 && coin->RTramchain.H.data->numblocks < bp->n ) @@ -1323,7 +1324,7 @@ int32_t iguana_realtime_update(struct iguana_info *coin) bp->isRT = 1; while ( (rdata= coin->RTramchain.H.data) != 0 && coin->RTheight <= coin->blocks.hwmchain.height ) { - printf("RT.%d vs hwm.%d\n",coin->RTheight,coin->blocks.hwmchain.height); + //printf("RT.%d vs hwm.%d\n",coin->RTheight,coin->blocks.hwmchain.height); dest = &coin->RTramchain; B = (void *)(long)((long)rdata + rdata->Boffset); bundlei = (coin->RTheight % coin->chain->bundlesize); @@ -1331,7 +1332,7 @@ int32_t iguana_realtime_update(struct iguana_info *coin) { iguana_blocksetcounters(coin,block,dest); B[bundlei] = block->RO; - double startmillis0 = OS_milliseconds(); static double totalmillis0; static int32_t num0; + startmillis0 = OS_milliseconds(); if ( iguana_ramchainfile(coin,dest,&blockR,bp,bundlei,block) == 0 ) { iguana_RTramchainfree(coin); @@ -1339,7 +1340,6 @@ int32_t iguana_realtime_update(struct iguana_info *coin) } else iguana_ramchain_free(coin,&blockR,1); totalmillis0 += (OS_milliseconds() - startmillis0); num0++; - printf("ramchainiterate.[%d] ave %.2f micros, total %.2f seconds\n",num0,(totalmillis0*1000.)/num0,totalmillis0/1000.); flag++; coin->blocks.RO[bp->bundleheight+bundlei] = block->RO; double startmillis = OS_milliseconds(); static double totalmillis; static int32_t num; @@ -1361,6 +1361,7 @@ int32_t iguana_realtime_update(struct iguana_info *coin) n = 0; if ( dest != 0 && flag != 0 && coin->RTheight >= coin->longestchain ) { + printf("ramchainiterate.[%d] ave %.2f micros, total %.2f seconds\n",num0,(totalmillis0*1000.)/num0,totalmillis0/1000.); while ( block != 0 ) { if ( bits256_cmp(iguana_blockhash(coin,coin->RTheight-n-1),block->RO.hash2) != 0 ) diff --git a/iguana/main.c b/iguana/main.c index 8ded83722..26e29159e 100755 --- a/iguana/main.c +++ b/iguana/main.c @@ -44,9 +44,9 @@ static int32_t initflag; int32_t HDRnet,netBLOCKS; cJSON *API_json; #ifdef __linux__ -int32_t IGUANA_NUMHELPERS = 16; +int32_t IGUANA_NUMHELPERS = 4; #else -int32_t IGUANA_NUMHELPERS = 8; +int32_t IGUANA_NUMHELPERS = 2; #endif struct iguana_jsonitem { struct queueitem DL; struct supernet_info *myinfo; uint32_t fallback,expired,allocsize; char **retjsonstrp; char remoteaddr[64]; uint16_t port; char jsonstr[]; };