Browse Source

test

release/v0.1
jl777 9 years ago
parent
commit
b33cdb8d77
  1. 37
      iguana/iguana_init.c

37
iguana/iguana_init.c

@ -468,7 +468,7 @@ struct iguana_info *iguana_coinstart(struct iguana_info *coin,int32_t initialhei
memset(&lastbundle,0,sizeof(lastbundle)); memset(&lastbundle,0,sizeof(lastbundle));
for (iter=coin->peers.numranked>8; iter<2; iter++) for (iter=coin->peers.numranked>8; iter<2; iter++)
{ {
//#ifdef __PNACL__ #ifdef __PNACL__
if ( iter == 0 ) if ( iter == 0 )
{ {
char **ipaddrs = 0; int32_t j,num; char **ipaddrs = 0; int32_t j,num;
@ -492,25 +492,28 @@ struct iguana_info *iguana_coinstart(struct iguana_info *coin,int32_t initialhei
else else
{ {
#include "confs/BTCD_hdrs.h" #include "confs/BTCD_hdrs.h"
bits256 hash2,allhash,hash1; int32_t bundlei,i,height; struct iguana_bundle *bp; if ( strcmp(coin->symbol,"BTCD") == 0 )
for (i=0; i<sizeof(BTCD_hdrs)/sizeof(*BTCD_hdrs); i++)
{ {
height = atoi(BTCD_hdrs[i][0]); bits256 hash2,allhash,hash1; int32_t bundlei,i,height; struct iguana_bundle *bp;
if ( height > (coin->blocks.maxbits - 1000) ) for (i=0; i<sizeof(BTCD_hdrs)/sizeof(*BTCD_hdrs); i++)
iguana_recvalloc(coin,height + 100000); {
hash2 = bits256_conv(BTCD_hdrs[i][1]); height = atoi(BTCD_hdrs[i][0]);
if ( BTCD_hdrs[i][2][0] != 0 ) if ( height > (coin->blocks.maxbits - 1000) )
allhash = bits256_conv(BTCD_hdrs[i][2]); iguana_recvalloc(coin,height + 100000);
if ( BTCD_hdrs[i][3][0] != 0 ) hash2 = bits256_conv(BTCD_hdrs[i][1]);
hash1 = bits256_conv(BTCD_hdrs[i][3]); if ( BTCD_hdrs[i][2][0] != 0 )
if ( (bp= iguana_bundlecreate(coin,&bundlei,height,hash2,allhash,0)) != 0 ) allhash = bits256_conv(BTCD_hdrs[i][2]);
lastbundle = iguana_bundleinitmap(coin,bp,height,hash2,hash1); if ( BTCD_hdrs[i][3][0] != 0 )
hash1 = bits256_conv(BTCD_hdrs[i][3]);
if ( (bp= iguana_bundlecreate(coin,&bundlei,height,hash2,allhash,0)) != 0 )
lastbundle = iguana_bundleinitmap(coin,bp,height,hash2,hash1);
}
if ( bits256_nonz(lastbundle) != 0 )
iguana_initfinal(coin,lastbundle);
break;
} }
if ( bits256_nonz(lastbundle) != 0 )
iguana_initfinal(coin,lastbundle);
break;
} }
//#endif #endif
sprintf(fname,"%s/%s_%s.txt",GLOBAL_CONFSDIR,coin->symbol,(iter == 0) ? "peers" : "hdrs"), OS_compatible_path(fname); sprintf(fname,"%s/%s_%s.txt",GLOBAL_CONFSDIR,coin->symbol,(iter == 0) ? "peers" : "hdrs"), OS_compatible_path(fname);
//sprintf(fname,"confs/%s_%s.txt",coin->symbol,(iter == 0) ? "peers" : "hdrs"); //sprintf(fname,"confs/%s_%s.txt",coin->symbol,(iter == 0) ? "peers" : "hdrs");
//sprintf(fname,"tmp/%s/%s.txt",coin->symbol,(iter == 0) ? "peers" : "hdrs"); //sprintf(fname,"tmp/%s/%s.txt",coin->symbol,(iter == 0) ? "peers" : "hdrs");

Loading…
Cancel
Save