Browse Source

test

release/v0.1
jl777 9 years ago
parent
commit
3e24e16eb6
  1. 1
      iguana/SuperNET.c
  2. 9
      iguana/iguana_bundles.c
  3. 1
      iguana/iguana_recv.c
  4. 2
      iguana/main.c

1
iguana/SuperNET.c

@ -788,6 +788,7 @@ char *SuperNET_p2p(struct iguana_info *coin,struct iguana_peer *addr,int32_t *de
if ( method != 0 && strcmp(method,"stop") == 0 )
{
addr->dead = (uint32_t)time(NULL);
addr->rank = 0;
free_json(json);
if ( ptr != 0 )
free(ptr);

9
iguana/iguana_bundles.c

@ -500,7 +500,10 @@ int32_t iguana_bundleissue(struct iguana_info *coin,struct iguana_bundle *bp,int
if ( peercounts[i] > threshold && (addr= coin->peers.ranked[i]) != 0 && now > bp->currenttime+lag && addr->dead == 0 )
{
if ( (numpeers > 64 || addr->laggard++ > 13) && coin->current == bp )
{
addr->dead = (uint32_t)time(NULL);
addr->rank = 0;
}
for (j=0; j<bp->n; j++)
{
if ( (block= bp->blocks[j]) != 0 && block->peerid == i && block->fpipbits == 0 )
@ -545,7 +548,9 @@ int32_t iguana_bundleissue(struct iguana_info *coin,struct iguana_bundle *bp,int
iguana_blockQ("kicka",coin,bp,i,block->RO.hash2,forceflag);
if ( forceflag != 0 && (addr= coin->peers.ranked[rand() % numpeers]) != 0 )
iguana_sendblockreqPT(coin,addr,bp,i,block->RO.hash2,0);
} else iguana_blockQ("kickb",coin,bp,i,block->RO.hash2,0);
}
else if ( forceflag != 0 )
iguana_blockQ("kickb",coin,bp,i,block->RO.hash2,0);
if ( forceflag != 0 )
bp->issued[i] = block->issued = now;
else bp->issued[i] = block->issued = saved;
@ -785,7 +790,7 @@ int32_t iguana_bundlefinish(struct iguana_info *coin,struct iguana_bundle *bp)
//#ifdef IGUANA_SERIALIZE_SPENDVECTORGEN
//if ( coin->MAXMEM <= 4*(1024L * 1024 * 1024) )
{
if ( (prevbp= coin->current) != 0 && prevbp->hdrsi < (coin->longestchain / coin->chain->bundlesize)-coin->MAXBUNDLES )
if ( (prevbp= coin->current) != 0 && prevbp->hdrsi < (coin->longestchain / coin->chain->bundlesize)-0*coin->MAXBUNDLES )
return(0);
}
//#endif

1
iguana/iguana_recv.c

@ -527,6 +527,7 @@ void iguana_checklongestchain(struct iguana_info *coin,struct iguana_bundle *bp,
{
printf("blacklist addr.(%s) height %d\n",addr->ipaddr,addr->height);
addr->dead = 1;
addr->rank = 0;
}
}
}

2
iguana/main.c

@ -1132,7 +1132,7 @@ void iguana_main(void *arg)
sleep(1);
char *str;
//iguana_launchcoin(MYINFO.rpcsymbol,cJSON_Parse("{}"));
if ( 1 && (str= SuperNET_JSON(&MYINFO,cJSON_Parse("{\"startpend\":2048,\"endpend\":2048,\"userhome\":\"/Users/jimbolaptop/Library/Application Support\",\"agent\":\"iguana\",\"method\":\"addcoin\",\"services\":129,\"maxpeers\":512,\"newcoin\":\"BTCD\",\"active\":1,\"numhelpers\":4,\"poll\":1}"),0)) != 0 )
if ( 1 && (str= SuperNET_JSON(&MYINFO,cJSON_Parse("{\"startpend\":128,\"endpend\":128,\"userhome\":\"/Users/jimbolaptop/Library/Application Support\",\"agent\":\"iguana\",\"method\":\"addcoin\",\"services\":129,\"maxpeers\":512,\"newcoin\":\"BTCD\",\"active\":1,\"numhelpers\":4,\"poll\":1}"),0)) != 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)) != 0 )

Loading…
Cancel
Save