Browse Source

test

release/v0.1
jl777 9 years ago
parent
commit
cec040283d
  1. 8
      iguana/iguana_peers.c
  2. 2
      iguana/iguana_recv.c
  3. 2
      iguana/main.c

8
iguana/iguana_peers.c

@ -996,13 +996,13 @@ void iguana_dedicatedloop(struct iguana_info *coin,struct iguana_peer *addr)
{
if ( run++ > 1000 )
{
printf("sleep\n");
sleep(1);
//printf("sleep\n");
usleep(100000);
}
else if ( addr->rank != 1 )
usleep(coin->polltimeout*250 + (rand() % (coin->polltimeout*250)));
usleep(coin->polltimeout*100 + (rand() % (coin->polltimeout*100)));
else usleep(100 + coin->polltimeout*1000);
} //else printf("flag.%d\n",flag);
} else run >>= 2;
}
if ( flag != 0 )
run = 0;

2
iguana/iguana_recv.c

@ -465,7 +465,7 @@ struct iguana_bundlereq *iguana_recvblock(struct iguana_info *coin,struct iguana
struct iguana_bundle *prevbp=0,*bp=0; int32_t prevbundlei=-2,bundlei = -2; struct iguana_block *prevblock,*block;
bp = iguana_bundleset(coin,&block,&bundlei,origblock);
//usleep(1000);
static int total; char str[65]; printf("RECV %s [%d:%d] block.%08x | %d\n",bits256_str(str,origblock->RO.hash2),bp!=0?bp->hdrsi:-1,bundlei,block->fpipbits,total++);
//static int total; char str[65]; printf("RECV %s [%d:%d] block.%08x | %d\n",bits256_str(str,origblock->RO.hash2),bp!=0?bp->hdrsi:-1,bundlei,block->fpipbits,total++);
iguana_bundlefind(coin,&prevbp,&prevbundlei,origblock->RO.prev_block);
if ( prevbp != 0 && prevbundlei >= 0 && (prevblock= iguana_blockfind(coin,origblock->RO.prev_block)) != 0 )
{

2
iguana/main.c

@ -318,7 +318,7 @@ void iguana_main(void *arg)
#ifdef __APPLE__
sleep(1);
char *str;
if ( (str= SuperNET_JSON(&MYINFO,cJSON_Parse("{\"agent\":\"iguana\",\"method\":\"addcoin\",\"services\":0,\"maxpeers\":64,\"coin\":\"BTCD\",\"active\":1}"),0)) != 0 )
if ( (str= SuperNET_JSON(&MYINFO,cJSON_Parse("{\"agent\":\"iguana\",\"method\":\"addcoin\",\"services\":0,\"maxpeers\":64,\"coin\":\"BTC\",\"active\":1}"),0)) != 0 )
{
printf("got.(%s)\n",str);
free(str);

Loading…
Cancel
Save