From a4d6943932a5a7bc8a47ad3face1d62c680f9d16 Mon Sep 17 00:00:00 2001 From: jl777 Date: Thu, 18 Aug 2016 23:20:22 -0300 Subject: [PATCH] test --- iguana/iguana777.c | 2 +- iguana/iguana_realtime.c | 3 ++- iguana/iguana_recv.c | 6 +++--- 3 files changed, 6 insertions(+), 5 deletions(-) diff --git a/iguana/iguana777.c b/iguana/iguana777.c index f6efc4e56..572c44ec7 100755 --- a/iguana/iguana777.c +++ b/iguana/iguana777.c @@ -895,7 +895,7 @@ struct iguana_info *iguana_setcoin(char *symbol,void *launched,int32_t maxpeers, if ( coin->MAXMEM == 0 ) coin->MAXMEM = IGUANA_DEFAULTRAM; coin->MAXMEM *= (1024L * 1024 * 1024); - coin->enableCACHE = 0;//(strcmp("BTCD",coin->symbol) == 0); + coin->enableCACHE = (strcmp("BTCD",coin->symbol) == 0); if ( jobj(json,"cache") != 0 ) coin->enableCACHE = juint(json,"cache"); if ( (coin->polltimeout= juint(json,"poll")) <= 0 ) diff --git a/iguana/iguana_realtime.c b/iguana/iguana_realtime.c index 723c04068..e54f09e6a 100755 --- a/iguana/iguana_realtime.c +++ b/iguana/iguana_realtime.c @@ -546,7 +546,7 @@ void *iguana_RTrawdata(struct iguana_info *coin,bits256 hash2,uint8_t *data,int3 if ( fwrite(recvlenp,1,sizeof(*recvlenp),fp) != sizeof(*recvlenp) || fwrite(numtxp,1,sizeof(*numtxp),fp) != sizeof(*numtxp) || fwrite(data,1,*recvlenp,fp) != *recvlenp ) printf("error writing %s len.%d numtx.%d\n",bits256_str(str,hash2),*recvlenp,*numtxp); fclose(fp); - //printf("numtx.%d len.%d %s\n",*numtxp,*recvlenp,fname); + printf("numtx.%d len.%d %s\n",*numtxp,*recvlenp,fname); } else printf("couldnt create %s\n",fname); } else if ( (ptr= OS_mapfile(fname,&filesize,0)) != 0 ) @@ -591,6 +591,7 @@ int32_t iguana_RTiterate(struct iguana_info *coin,int32_t offset,struct iguana_b { char str[65]; //printf("errs.%d cant load %s ht.%d polarity.%lld numtx.%d %p recvlen.%d\n",errs,bits256_str(str,block->RO.hash2),block->height,(long long)polarity,coin->RTnumtx[offset],coin->RTrawdata[offset],coin->RTrecvlens[offset]); + coin->RTrecvlens[offset] = 0; coin->RTrawdata[offset] = iguana_RTrawdata(coin,block->RO.hash2,0,&coin->RTrecvlens[offset],&coin->RTnumtx[offset],0); if ( (numtx= coin->RTnumtx[offset]) == 0 || (serialized= coin->RTrawdata[offset]) == 0 || (recvlen= coin->RTrecvlens[offset]) == 0 ) { diff --git a/iguana/iguana_recv.c b/iguana/iguana_recv.c index 71a6038e5..bcd50b4c3 100755 --- a/iguana/iguana_recv.c +++ b/iguana/iguana_recv.c @@ -527,7 +527,7 @@ void iguana_gotblockM(struct iguana_info *coin,struct iguana_peer *addr,struct i netBLOCKS++; } req->addr = addr; - if ( req->zblock.mainchain == 0 || req->zblock.valid == 0 || req->zblock.txvalid == 0 || iguana_RTrawdata(coin,origtxdata->zblock.RO.hash2,0,&len,&numtx,1) == 0 ) + if ( (bits256_cmp(origtxdata->zblock.RO.hash2,coin->blocks.hwmchain.RO.hash2) == 0 || req->zblock.mainchain == 0 || req->zblock.valid == 0 || req->zblock.txvalid == 0) && iguana_RTrawdata(coin,origtxdata->zblock.RO.hash2,0,&len,&numtx,1) == 0 ) queue_enqueue("recvQ",&coin->recvQ,&req->DL,0); } } @@ -599,7 +599,7 @@ void iguana_gotblockhashesM(struct iguana_info *coin,struct iguana_peer *addr,bi { if ( n > coin->chain->bundlesize ) iguana_sendblockreqPT(coin,addr,0,-1,blockhashes[1],0); - if ( 0 && coin->RTheight > 0 ) + if ( 1 && coin->RTheight > 0 ) { for (i=1; isymbol,bits256_str(str,origblock->RO.hash2)); + printf("%s received.(%s)\n",coin->symbol,bits256_str(str,origblock->RO.hash2)); if ( (block= iguana_blockfind("recv",coin,origblock->RO.hash2)) != 0 ) iguana_blockcopy(coin->chain->zcash,coin->chain->auxpow,coin,block,(struct iguana_block *)origblock); if ( bits256_nonz(origblock->RO.prev_block) != 0 )