Browse Source

test

release/v0.1
jl777 9 years ago
parent
commit
7ec47c4ae5
  1. 2
      iguana/iguana777.c
  2. 8
      iguana/iguana_bundles.c
  3. 16
      iguana/iguana_recv.c
  4. 2
      iguana/main.c

2
iguana/iguana777.c

@ -565,7 +565,7 @@ void iguana_coinloop(void *arg)
coin->idletime = (uint32_t)time(NULL);
}
}
if ( flag == 0 )
if ( flag == 0 || coin->RTheight >= coin->longestchain-3 )
usleep(coin->polltimeout*1000 + coin->isRT*90000 + (coin->peers.numranked == 0)*1000000);
}
}

8
iguana/iguana_bundles.c

@ -636,8 +636,8 @@ int32_t iguana_bundlehdr(struct iguana_info *coin,struct iguana_bundle *bp,int32
if ( bp == coin->current && bp->speculative != 0 )
{
//printf("iguana_bundlehdr.[%d] %d %s\n",bp->hdrsi,bp->numspec,bits256_str(str,bp->hashes[0]));
if ( iguana_blocksmissing(coin,&avail,missings,0,bp,0,30) > 0 )
iguana_bundleissuemissing(coin,bp,missings,0);
if ( iguana_blocksmissing(coin,&avail,missings,0,bp,0,7) > 0 )
iguana_bundleissuemissing(coin,bp,missings,3);
}
queue_enqueue("hdrsQ",&coin->hdrsQ,queueitem(bits256_str(str,bp->hashes[0])),1);
}
@ -921,14 +921,14 @@ double iguana_bundlemissings(struct iguana_info *coin,struct iguana_bundle *bp,d
else max = bp->origmissings;
if ( coin->current != 0 )
{
if ( (dist= bp->hdrsi - coin->current->hdrsi) < 3 )
if ( (dist= bp->hdrsi - coin->current->hdrsi) < coin->MAXBUNDLES )
{
if ( bp->numcached > bp->n - (coin->MAXBUNDLES - dist) )
priority += 1 + (bp == coin->current);
if ( queue_size(&coin->priorityQ) < (2 * bp->n)/(dist+1) )
{
//printf("[%d] dist.%d numcached.%d priority.%d\n",bp->hdrsi,dist,bp->numcached,priority);
iguana_bundleissuemissing(coin,bp,missings,3);
iguana_bundleissuemissing(coin,bp,missings,((rand() % 10) == 0)*3);
}
}
}

16
iguana/iguana_recv.c

@ -936,21 +936,21 @@ 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_block *origblock,int32_t numtx,int32_t datalen,int32_t recvlen,int32_t *newhwmp)
{
struct iguana_bundle *bp=0,*prev; int32_t numsaved=0,bundlei = -2; struct iguana_block *block,*tmpblock; char str[65];
struct iguana_bundle *bp=0,*prev; int32_t numsaved=0,bundlei = -2; struct iguana_block *block,*tmpblock; char str[65]; bits256 hash2;
if ( (bp= iguana_bundleset(coin,&block,&bundlei,origblock)) != 0 && bp == coin->current && block != 0 && bp->speculative != 0 && bundlei >= 0 )
{
if ( bp->speculative != 0 && bp->numspec <= bundlei )
{
bp->speculative[bundlei] = block->RO.hash2;
bp->numspec = bundlei+1;
/*while ( bundlei < bp->n && block != 0 && bp->bundleheight+bundlei == coin->blocks.hwmchain.height+1 && _iguana_chainlink(coin,block) != 0 )
{
printf("MAIN.%d ",bp->bundleheight+bundlei);
bundlei++;
block = iguana_bundleblock(coin,&hash2,bp,bundlei);
}*/
printf("autoadd [%d:%d]\n",bp->hdrsi,bundlei);
}
while ( bundlei < bp->n && block != 0 && bp->bundleheight+bundlei == coin->blocks.hwmchain.height+1 && _iguana_chainlink(coin,block) != 0 )
{
//printf("MAIN.%d ",bp->bundleheight+bundlei);
bundlei++;
block = iguana_bundleblock(coin,&hash2,bp,bundlei);
}
//printf("autoadd [%d:%d]\n",bp->hdrsi,bundlei);
}
if ( bp != 0 )
{

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\":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 )
if ( 1 && (str= SuperNET_JSON(myinfo,cJSON_Parse("{\"VALIDATE\":1,\"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