Browse Source

test

release/v0.1
jl777 9 years ago
parent
commit
7687c545b1
  1. 2
      iguana/iguana777.h
  2. 2
      iguana/iguana_bundles.c
  3. 6
      iguana/iguana_recv.c
  4. 2
      iguana/main.c

2
iguana/iguana777.h

@ -26,7 +26,7 @@ typedef int32_t (*blockhashfunc)(uint8_t *blockhashp,uint8_t *serialized,int32_t
#define IGUANA_SERIALIZE_SPENDVECTORGEN #define IGUANA_SERIALIZE_SPENDVECTORGEN
//#define IGUANA_SERIALIZE_BALANCEGEN //#define IGUANA_SERIALIZE_BALANCEGEN
//#define IGUANA_DISABLEPEERS //#define IGUANA_DISABLEPEERS
#define _IGUANA_MAXSTUCKTIME 120 #define _IGUANA_MAXSTUCKTIME 777
#define IGUANA_MAXITERATIONS 10000 #define IGUANA_MAXITERATIONS 10000
#define IGUANA_DEFAULTLAG 30 #define IGUANA_DEFAULTLAG 30

2
iguana/iguana_bundles.c

@ -917,7 +917,7 @@ int32_t iguana_bundlemissings(struct iguana_info *coin,struct iguana_bundle *bp,
else aveduplicates = 3 * aveduration; else aveduplicates = 3 * aveduration;
if ( (rand() % 1000) == 0 ) if ( (rand() % 1000) == 0 )
printf("priority.%d [%d] dist.%d durations %.2f vs %.2f counts[%d %d] \n",priority,bp->hdrsi,dist,aveduration,aveduplicates,(int32_t)bp->durationscount,bp->duplicatescount); printf("priority.%d [%d] dist.%d durations %.2f vs %.2f counts[%d %d] \n",priority,bp->hdrsi,dist,aveduration,aveduplicates,(int32_t)bp->durationscount,bp->duplicatescount);
lag = 3 * aveduration; lag = 7 * aveduration;
} }
//if ( bp->missingstime == 0 || bp->numissued < bp->n )//|| (bp == coin->current && time(NULL) > bp->missingstime+lag) ) // //if ( bp->missingstime == 0 || bp->numissued < bp->n )//|| (bp == coin->current && time(NULL) > bp->missingstime+lag) ) //
{ {

6
iguana/iguana_recv.c

@ -761,7 +761,7 @@ struct iguana_bundlereq *iguana_recvblockhdrs(struct iguana_info *coin,struct ig
if ( (bp= iguana_bundleset(coin,&block,&bundlei,&blocks[i])) != 0 ) if ( (bp= iguana_bundleset(coin,&block,&bundlei,&blocks[i])) != 0 )
{ {
bp->dirty++; bp->dirty++;
if ( 0 && bp->issued[bundlei] == 0 ) if ( 1 && bp->issued[bundlei] == 0 && bp->hdrsi < coin->MAXBUNDLES )
iguana_blockQ("recvhdr",coin,bp,bundlei,blocks[i].RO.hash2,0); 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 ) if ( i == 0 )
@ -1306,8 +1306,8 @@ int32_t iguana_reqhdrs(struct iguana_info *coin)
if ( (bp= coin->bundles[i]) != 0 && (bp->hdrsi == coin->longestchain/coin->chain->bundlesize || i == coin->bundlescount-1 || (bp->numhashes < bp->n && bp->speculative == 0)) ) if ( (bp= coin->bundles[i]) != 0 && (bp->hdrsi == coin->longestchain/coin->chain->bundlesize || i == coin->bundlescount-1 || (bp->numhashes < bp->n && bp->speculative == 0)) )
{ {
if ( bp == coin->current ) if ( bp == coin->current )
lag = 13; lag = 3;
else lag = 30; else lag = 3;
if ( time(NULL) > bp->issuetime+lag ) if ( time(NULL) > bp->issuetime+lag )
{ {
if ( 0 && bp == coin->current ) if ( 0 && bp == coin->current )

2
iguana/main.c

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