Browse Source

test

release/v0.1
jl777 9 years ago
parent
commit
d5a1564efc
  1. 2
      iguana/iguana777.h
  2. 6
      iguana/iguana_bundles.c
  3. 1
      iguana/iguana_ramchain.c
  4. 2
      iguana/iguana_recv.c
  5. 2
      iguana/main.c

2
iguana/iguana777.h

@ -43,7 +43,7 @@ typedef int32_t (*blockhashfunc)(uint8_t *blockhashp,uint8_t *serialized,int32_t
#define IGUANA_TAILPERCENTAGE 1.0
#define IGUANA_MAXPENDHDRS 1
#define IGUANA_MAXPENDINGREQUESTS 2
#define IGUANA_PENDINGREQUESTS 32
#define IGUANA_PENDINGREQUESTS 512
#define IGUANA_MINPENDBUNDLES 2
#define IGUANA_MAXPENDBUNDLES 128
#define IGUANA_BUNDLELOOP 77

6
iguana/iguana_bundles.c

@ -594,7 +594,7 @@ int32_t iguana_bundleready(struct iguana_info *coin,struct iguana_bundle *bp)
void iguana_bundleissuemissing(struct iguana_info *coin,struct iguana_bundle *bp,uint8_t *missings,int32_t priority)
{
int32_t i,tmp,tmp2; bits256 hash2; double aveduration;
if ( bp->emitfinish != 0 || time(NULL) < bp->missingstime+3 )
if ( bp->emitfinish != 0 || (priority == 0 && time(NULL) < bp->missingstime+30) )
return;
if ( bp->durationscount != 0 )
aveduration = (double)bp->totaldurations / bp->durationscount;
@ -844,7 +844,7 @@ int32_t iguana_bundleiters(struct iguana_info *coin,struct OS_memspace *mem,stru
if ( (lag/coin->MAXSTUCKTIME) > coin->stuckiters )
{
coin->stuckiters = (int32_t)(lag/coin->MAXSTUCKTIME);
if ( lag > 2*coin->MAXSTUCKTIME )
//if ( lag > 2*coin->MAXSTUCKTIME )
{
while ( (breq= queue_dequeue(&coin->blocksQ,0)) != 0 )
myfree(breq,sizeof(*breq));
@ -854,7 +854,7 @@ int32_t iguana_bundleiters(struct iguana_info *coin,struct OS_memspace *mem,stru
if ( bp->durationscount != 0 )
aveduration = (double)bp->totaldurations / bp->durationscount;
else aveduration = IGUANA_DEFAULTLAG/3 + 1;
if ( (n= iguana_bundlerequests(coin,missings,&tmp,&tmp2,bp,aveduration,priority)) > 0 )
if ( (n= iguana_bundlerequests(coin,missings,&tmp,&tmp2,bp,5*aveduration,priority)) > 0 )
printf("issued %d priority requests [%d] to unstick stuckiters.%d lag.%d\n",n,bp->hdrsi,coin->stuckiters,lag);
}
}

1
iguana/iguana_ramchain.c

@ -2396,6 +2396,7 @@ int32_t iguana_bundlesaveHT(struct iguana_info *coin,struct OS_memspace *mem,str
}
sprintf(dirname,"%s/%s/%d",GLOBALTMPDIR,coin->symbol,bp->bundleheight), OS_portable_rmdir(dirname,1);
}
sleep(1);
iguana_bundleload(coin,&newchain,bp,0);
newchain.A = 0;
}

2
iguana/iguana_recv.c

@ -331,7 +331,7 @@ void iguana_gotblockM(struct iguana_info *coin,struct iguana_peer *addr,struct i
sizeAfteremit += recvlen;
if ( (block= bp->blocks[bundlei]) != 0 )
iguana_bundletime(coin,bp,bundlei,block,1);
printf("got [%d:%d] with emitfinish.%u\n",bp->hdrsi,bundlei,bp->emitfinish);
//printf("got [%d:%d] with emitfinish.%u\n",bp->hdrsi,bundlei,bp->emitfinish);
return;
}
bp->dirty++;

2
iguana/main.c

@ -1191,7 +1191,7 @@ void iguana_main(void *arg)
if ( 1 )
{
sleep(1);
if ( 1 && (str= SuperNET_JSON(myinfo,cJSON_Parse("{\"prefetchlag\":13,\"startpend\":128,\"endpend\":64,\"userhome\":\"/Users/jimbolaptop/Library/Application Support\",\"agent\":\"iguana\",\"method\":\"addcoin\",\"services\":128,\"maxpeers\":512,\"newcoin\":\"BTCD\",\"active\":1,\"numhelpers\":8,\"poll\":1}"),0,myinfo->rpcport)) != 0 )
if ( 1 && (str= SuperNET_JSON(myinfo,cJSON_Parse("{\"prefetchlag\":13,\"startpend\":256,\"endpend\":128,\"userhome\":\"/Users/jimbolaptop/Library/Application Support\",\"agent\":\"iguana\",\"method\":\"addcoin\",\"services\":128,\"maxpeers\":118,\"newcoin\":\"BTCD\",\"active\":1,\"numhelpers\":8,\"poll\":1}"),0,myinfo->rpcport)) != 0 )
{
free(str);
if ( 0 && (str= SuperNET_JSON(myinfo,cJSON_Parse("{\"userhome\":\"/Users/jimbolaptop/Library/Application Support\",\"agent\":\"iguana\",\"method\":\"addcoin\",\"services\":1024,\"maxpeers\":256,\"newcoin\":\"BTCD\",\"active\":1}"),0,myinfo->rpcport)) != 0 )

Loading…
Cancel
Save