Browse Source

test

release/v0.1
jl777 9 years ago
parent
commit
35c686573a
  1. 8
      iguana/iguana777.h
  2. 15
      iguana/iguana_bundles.c
  3. 2
      iguana/iguana_peers.c
  4. 2
      iguana/main.c

8
iguana/iguana777.h

@ -76,13 +76,13 @@ struct iguana_txdatabits { uint64_t addrind:IGUANA_LOG2MAXPEERS,filecount:10,fpo
#define IGUANA_DEDICATED_THREADS
#ifdef IGUANA_DEDICATED_THREADS
#define IGUANA_MAXCONNTHREADS 32
#define IGUANA_MAXCONNTHREADS 16
#define IGUANA_MAXSENDTHREADS (IGUANA_MAXPEERS>>2)
#define IGUANA_MAXRECVTHREADS (IGUANA_MAXPEERS>>2)
#else
#define IGUANA_MAXCONNTHREADS 64
#define IGUANA_MAXSENDTHREADS 64
#define IGUANA_MAXRECVTHREADS 64
#define IGUANA_MAXCONNTHREADS 16
#define IGUANA_MAXSENDTHREADS 16
#define IGUANA_MAXRECVTHREADS 16
#endif

15
iguana/iguana_bundles.c

@ -537,7 +537,7 @@ int32_t iguana_bundleissuemissing(struct iguana_info *coin,struct iguana_bundle
if ( firsti < 0 )
firsti = i;
lasti = i;
if ( bp->numsaved > bp->n-10 || ((bp->issued[i] == 0 || bp->issued[i] > 1) && now > bp->issued[i]+lag) )
if ( priority > 2 || bp->numsaved > bp->n-1 || ((bp->issued[i] == 0 || bp->issued[i] > 1) && now > bp->issued[i]+lag) )
{
iguana_bundleblock(coin,&hash2,bp,i);
if ( bits256_nonz(hash2) != 0 )
@ -547,6 +547,10 @@ int32_t iguana_bundleissuemissing(struct iguana_info *coin,struct iguana_bundle
if ( (addr= coin->peers.ranked[rand() % max]) != 0 && addr->usock >= 0 && addr->dead == 0 )
{
struct iguana_blockreq *req = 0;
if ( priority > 2 )
iguana_sendblockreqPT(coin,addr,bp,i,hash2,0);
else
{
req = mycalloc('y',1,sizeof(*req));
req->hash2 = hash2;
req->bp = bp;
@ -554,12 +558,13 @@ int32_t iguana_bundleissuemissing(struct iguana_info *coin,struct iguana_bundle
req->bundlei = i;
bp->issued[i] = 1;
queue_enqueue("missing",&coin->priorityQ,&req->DL,0);
}
n++;
}
}
}
}
if ( firsti >= 0 && (coin->enableCACHE != 0 || bp == coin->current) )
if ( priority <= 2 && firsti >= 0 && (coin->enableCACHE != 0 || bp == coin->current) )
{
//printf("[%d] first missing.%d of %d\n",bp->hdrsi,firsti,nonz);
iguana_bundleblock(coin,&hash2,bp,firsti);
@ -638,7 +643,7 @@ int32_t iguana_bundlehdr(struct iguana_info *coin,struct iguana_bundle *bp,int32
}
if ( coin->enableCACHE != 0 && (bp == coin->current || bp->hdrsi == coin->bundlescount-1) && bits256_nonz(bp->nextbundlehash2) == 0 )
{
iguana_bundleissuemissing(coin,bp,1,.1);
iguana_bundleissuemissing(coin,bp,3,1.);
/*if ( bp == coin->current )
{
mult = 1.;
@ -1127,11 +1132,11 @@ void iguana_bundlestats(struct iguana_info *coin,char *str,int32_t lag)
myfree(breq,sizeof(*breq));
while ( (breq= queue_dequeue(&coin->priorityQ,0)) != 0 )
myfree(breq,sizeof(*breq));
for (i=0; i<bp->n; i++)
/*for (i=0; i<bp->n; i++)
{
if ( (block= bp->blocks[i]) != 0 && block->txvalid == 0 )
iguana_blockQ("stuck",coin,bp,i,block->RO.hash2,1);
}
}*/
}
if ( (n= iguana_bundleissuemissing(coin,bp,1,1.)) > 0 )
printf("issued %d priority requests [%d] to unstick stuckiters.%d lag.%d\n",n,bp->hdrsi,coin->stuckiters,lag);

2
iguana/iguana_peers.c

@ -1051,7 +1051,7 @@ void iguana_dedicatedloop(struct iguana_info *coin,struct iguana_peer *addr)
run = 0;
while ( addr->usock >= 0 && addr->dead == 0 && coin->peers.shuttingdown == 0 )
{
if ( 1 && (req= queue_dequeue(&coin->cacheQ,0)) != 0 )
if ( 0 && (req= queue_dequeue(&coin->cacheQ,0)) != 0 )
{
if ( req->datalen != 0 )
{

2
iguana/main.c

@ -1197,7 +1197,7 @@ void iguana_main(void *arg)
if ( 1 )
{
sleep(1);
if ( 1 && (str= SuperNET_JSON(myinfo,cJSON_Parse("{\"VALIDATE\":1,\"prefetchlag\":13,\"startpend\":2048,\"endpend\":2048,\"userhome\":\"/Users/jimbolaptop/Library/Application Support\",\"agent\":\"iguana\",\"method\":\"addcoin\",\"services\":0,\"maxpeers\":256,\"newcoin\":\"BTCD\",\"active\":1,\"numhelpers\":8,\"poll\":10}"),0,myinfo->rpcport)) != 0 )
if ( 1 && (str= SuperNET_JSON(myinfo,cJSON_Parse("{\"VALIDATE\":1,\"prefetchlag\":13,\"startpend\":2048,\"endpend\":2048,\"userhome\":\"/Users/jimbolaptop/Library/Application Support\",\"agent\":\"iguana\",\"method\":\"addcoin\",\"services\":0,\"maxpeers\":64,\"newcoin\":\"BTCD\",\"active\":1,\"numhelpers\":8,\"poll\":10}"),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