Browse Source

test

release/v0.1
jl777 9 years ago
parent
commit
a4d6943932
  1. 2
      iguana/iguana777.c
  2. 3
      iguana/iguana_realtime.c
  3. 6
      iguana/iguana_recv.c

2
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 )

3
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 )
{

6
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; i<num; i++)
//if ( iguana_bundlehash2_check(coin,blockhashes[i]) == 0 )
@ -1211,7 +1211,7 @@ struct iguana_bundlereq *iguana_recvblockhashes(struct iguana_info *coin,struct
struct iguana_bundlereq *iguana_recvblock(struct iguana_info *coin,struct iguana_peer *addr,struct iguana_bundlereq *req,struct iguana_zblock *origblock,int32_t numtx,int32_t datalen,int32_t recvlen,int32_t *newhwmp)
{
struct iguana_bundle *bp=0,*prev; int32_t n,bundlei = -2; struct iguana_block *block,*next,*prevblock; char str[65]; bits256 hash2;
//printf("%s received.(%s)\n",coin->symbol,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 )

Loading…
Cancel
Save