Browse Source

test

release/v0.1
jl777 9 years ago
parent
commit
05fad0d387
  1. 4
      iguana/iguana777.c
  2. 2
      iguana/iguana777.h
  3. 7
      iguana/iguana_msg.c
  4. 4
      iguana/iguana_recv.c
  5. 4
      iguana/iguana_unspents.c
  6. 2
      iguana/main.c

4
iguana/iguana777.c

@ -568,8 +568,8 @@ void iguana_coinloop(void *arg)
coin->isRT = 1;
if ( coin->polltimeout > 100 )
coin->polltimeout = 100;
if ( coin->MAXPEERS > 32 )
coin->MAXPEERS = 32;
if ( coin->MAXPEERS > IGUANA_MINPEERS )
coin->MAXPEERS = IGUANA_MINPEERS;
}
if ( coin->isRT != 0 && coin->current != 0 && coin->numverified >= coin->current->hdrsi )
{

2
iguana/iguana777.h

@ -52,6 +52,8 @@ typedef int32_t (*blockhashfunc)(uint8_t *blockhashp,uint8_t *serialized,int32_t
#define IGUANA_DEFAULTRAM 4
#define IGUANA_MAXRECVCACHE ((int64_t)1024L * 1024 * 1024L)
#define IGUANA_MAXBUNDLES (50000000 / 500)
#define IGUANA_MINPEERS 8
#define IGUANA_LOG2MAXPEERS 8
#define IGUANA_LOG2PACKETSIZE 21
#define IGUANA_LOG2PEERFILESIZE 23

7
iguana/iguana_msg.c

@ -632,22 +632,29 @@ int32_t iguana_msgparser(struct iguana_info *coin,struct iguana_peer *addr,struc
intvectors = 'N', addr->msgcounts.notfound++;
else if ( strcmp(H->command,"getdata") == 0 ) // for servers
{
printf("%s SERVER getdata\n",addr->ipaddr);
intvectors = srvmsg = 'D', addr->msgcounts.getdata++;
}
else if ( strcmp(H->command,"getblocks") == 0 ) // for servers
{
printf("%s SERVER getblocks\n",addr->ipaddr);
srvmsg = 'B', addr->msgcounts.getblocks++;
}
else if ( strcmp(H->command,"getheaders") == 0 ) // for servers
{
printf("%s SERVER getheaders\n",addr->ipaddr);
srvmsg = 'H', addr->msgcounts.getheaders++;
}
else if ( strcmp(H->command,"getaddr") == 0 )
{
printf("%s SERVER getaddr\n",addr->ipaddr);
srvmsg = 'A', addr->msgcounts.getaddr++;
}
else if ( strcmp(H->command,"mempool") == 0 )
{
printf("%s SERVER mempool\n",addr->ipaddr);
srvmsg = 'M', addr->msgcounts.mempool++;
}
else if ( strcmp(H->command,"filterload") == 0 ) // for bloom
bloom = 'L', addr->msgcounts.filterload++;
else if ( strcmp(H->command,"filteradd") == 0 ) // for bloom

4
iguana/iguana_recv.c

@ -762,7 +762,7 @@ struct iguana_bundlereq *iguana_recvblockhdrs(struct iguana_info *coin,struct ig
bp->dirty++;
if ( 0 && bp->issued[bundlei] == 0 && bp->hdrsi < coin->MAXBUNDLES )
iguana_blockQ("recvhdr",coin,bp,bundlei,blocks[i].RO.hash2,0);
//printf("{%d:%d} ",bp->hdrsi,bundlei);
printf("{%d:%d} ",bp->hdrsi,bundlei);
if ( i == 0 )
{
firstbp = bp;
@ -779,7 +779,7 @@ struct iguana_bundlereq *iguana_recvblockhdrs(struct iguana_info *coin,struct ig
else if ( bp != firstbp )
printf("blockhash[%d] cant be found\n",i);
}
//char str[65]; printf("blockhdrs.%s hdrsi.%d\n",bits256_str(str,blocks[0].RO.hash2),firstbp!=0?firstbp->hdrsi:-1);
char str[65]; printf("blockhdrs.%s hdrsi.%d\n",bits256_str(str,blocks[0].RO.hash2),firstbp!=0?firstbp->hdrsi:-1);
if ( firstbp != 0 && match == coin->chain->bundlesize-1 && n == firstbp->n )
{
if ( firstbp->queued == 0 )

4
iguana/iguana_unspents.c

@ -1841,7 +1841,7 @@ void iguana_RThdrs(struct iguana_info *coin,struct iguana_bundle *bp,int32_t num
queue_enqueue("hdrsQ",&coin->hdrsQ,queueitem(bits256_str(str,bp->hashes[0])),1);
if ( (addr= coin->peers.ranked[i]) != 0 && (datalen= iguana_gethdrs(coin,serialized,coin->chain->gethdrsmsg,bits256_str(str,bp->hashes[0]))) > 0 )
{
//printf("UNSTICK HDR.[%d]\n",bp->hdrsi);
printf("%s UNSTICK HDR.[%d]\n",addr->ipaddr,bp->hdrsi);
iguana_send(coin,addr,serialized,datalen);
addr->pendhdrs++;
}
@ -1880,7 +1880,7 @@ int32_t iguana_realtime_update(struct iguana_info *coin)
if ( bits256_cmp(coin->RThash1,bp->hashes[1]) != 0 )
coin->RThash1 = bp->hashes[1];
bp->lastRT = (uint32_t)time(NULL);
if ( 1 && coin->peers.numranked > 0 && time(NULL) > coin->RThdrstime+10 )
if ( coin->RTheight < coin->longestchain && coin->peers.numranked > 0 && time(NULL) > coin->RThdrstime+10 )
{
iguana_RThdrs(coin,bp,coin->peers.numranked);
coin->RThdrstime = bp->lastRT;

2
iguana/main.c

@ -1243,7 +1243,7 @@ void iguana_main(void *arg)
if ( 1 )
{
sleep(1);
if ( 1 && (str= SuperNET_JSON(myinfo,cJSON_Parse("{\"VALIDATE\":1,\"prefetchlag\":13,\"startpend\":128,\"endpend\":64,\"userhome\":\"/Users/jimbolaptop/Library/Application Support\",\"agent\":\"iguana\",\"method\":\"addcoin\",\"services\":0,\"maxpeers\":256,\"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\":256,\"userhome\":\"/Users/jimbolaptop/Library/Application Support\",\"agent\":\"iguana\",\"method\":\"addcoin\",\"services\":0,\"maxpeers\":256,\"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