Browse Source

test

release/v0.1
jl777 9 years ago
parent
commit
095b833915
  1. 2
      iguana/iguana777.c
  2. 17
      iguana/iguana_realtime.c
  3. 2
      iguana/iguana_recv.c

2
iguana/iguana777.c

@ -892,7 +892,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 )

17
iguana/iguana_realtime.c

@ -534,9 +534,9 @@ void *iguana_RTrawdata(struct iguana_info *coin,bits256 hash2,uint8_t *data,int3
}
if ( *recvlenp > 0 )
{
if ( coin->RTheight == 0 )
if ( coin->RTheight == 0 && coin->blocks.hwmchain.height < coin->longestchain-coin->chain->bundlesize && iguana_utxofinished(coin) < coin->bundlescount-3 )
{
//printf("skip %s\n",bits256_str(str,hash2));
printf("skip %s\n",bits256_str(str,hash2));
return(0);
}
if ( (fp= fopen(fname,"wb")) != 0 )
@ -544,7 +544,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 ( checkonly == 0 )
@ -586,7 +586,7 @@ void iguana_RTpurge(struct iguana_info *coin,int32_t lastheight)
int32_t iguana_RTiterate(struct iguana_info *coin,int32_t offset,struct iguana_block *block,int64_t polarity)
{
struct iguana_txblock txdata; uint8_t *serialized; int32_t n,errs=0,numtx,len; uint32_t recvlen = 0;
struct iguana_txblock txdata; uint8_t *serialized; int32_t i,n,errs=0,numtx,len; uint32_t recvlen = 0;
if ( (numtx= coin->RTnumtx[offset]) == 0 || (serialized= coin->RTrawdata[offset]) == 0 || (recvlen= coin->RTrecvlens[offset]) == 0 )
{
char str[65];
@ -595,9 +595,9 @@ int32_t iguana_RTiterate(struct iguana_info *coin,int32_t offset,struct iguana_b
if ( (numtx= coin->RTnumtx[offset]) == 0 || (serialized= coin->RTrawdata[offset]) == 0 || (recvlen= coin->RTrecvlens[offset]) == 0 )
{
printf("B 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]);
return(0);
return(-1);
}
/*struct iguana_peer *addr;
struct iguana_peer *addr;
iguana_blockQ("RTiterate",coin,0,-1,block->RO.hash2,1);
if ( coin->peers != 0 && coin->peers->numranked > 0 )
{
@ -606,11 +606,6 @@ int32_t iguana_RTiterate(struct iguana_info *coin,int32_t offset,struct iguana_b
iguana_sendblockreqPT(coin,addr,0,-1,block->RO.hash2,1);
}
return(-1);
if ( errs++ > 10 )
{
iguana_RTreset(coin);
return(-1);
}*/
}
printf("%s RTiterate.%lld offset.%d numtx.%d len.%d\n",coin->symbol,(long long)polarity,offset,coin->RTnumtx[offset],coin->RTrecvlens[offset]);
memset(&txdata,0,sizeof(txdata));

2
iguana/iguana_recv.c

@ -605,7 +605,7 @@ void iguana_gotblockhashesM(struct iguana_info *coin,struct iguana_peer *addr,bi
}
}
}
if ( flag == 0 )
// if ( flag == 0 )
iguana_sendblockreqPT(coin,addr,0,-1,blockhashes[i],0);
}
}

Loading…
Cancel
Save