Browse Source

test

release/v0.1
jl777 9 years ago
parent
commit
c48c06dee1
  1. 6
      iguana/iguana_peers.c
  2. 2
      iguana/iguana_ramchain.c

6
iguana/iguana_peers.c

@ -107,7 +107,7 @@ struct iguana_iAddr *iguana_iAddrhashfind(struct iguana_info *coin,uint64_t ipbi
uint32_t iguana_rwiAddrind(struct iguana_info *coin,int32_t rwflag,struct iguana_iAddr *iA,uint32_t ind)
{
FILE *fp; char fname[512],hexstr[65]; uint32_t ipbits; int32_t i,n,m,retval = 0; struct iguana_iAddr tmp,*ptr;
FILE *fp; char fname[512],hexstr[65],ipaddr[64]; uint32_t ipbits; int32_t i,n,m,retval = 0; struct iguana_iAddr tmp,*ptr;
sprintf(fname,"DB/%s_peers.dat",coin->symbol);
OS_compatible_path(fname);
if ( rwflag < 0 || iA == 0 )
@ -171,6 +171,7 @@ uint32_t iguana_rwiAddrind(struct iguana_info *coin,int32_t rwflag,struct iguana
printf("iAddr: error loading.[%d]\n",ind);
else
{
iA->status = 0;
if ( (iA= iguana_iAddrhashset(coin,iA,ind)) != 0 )
{
retval = iA->hh.itemind+1;
@ -213,7 +214,8 @@ uint32_t iguana_rwiAddrind(struct iguana_info *coin,int32_t rwflag,struct iguana
if ( (iA= iguana_iAddrhashset(coin,iA,ind)) != 0 )
{
retval = iA->hh.itemind+1;
//printf("W status.%d ipbits.%x ind.%d saved iA->ind.%d retval.%d numiAddrs.%d\n",iA->status,(uint32_t)ipbits,ind,iA->hh.itemind,retval,coin->numiAddrs);
expand_ipbits(ipaddr,iA->ipbits);
printf("%s status.%d lastkilled.%u ipbits.%x ind.%d saved iA->ind.%d retval.%d numiAddrs.%d\n",ipaddr,iA->status,iA->lastkilled,(uint32_t)ipbits,ind,iA->hh.itemind,retval,coin->numiAddrs);
}
}
} else printf("iAddr: error seeking.[%d] %ld vs %ld\n",ind,ftell(fp),ind * sizeof(*iA));

2
iguana/iguana_ramchain.c

@ -963,7 +963,7 @@ long iguana_ramchain_save(struct iguana_info *coin,RAMCHAIN_FUNC,uint32_t ipbits
else
{
fclose(fp);
if ( (fp= fopen(fname,"wb")) != 0 )
if ( (fp= fopen(fname,"wb")) == 0 )
{
printf("iguana_ramchain_save b: couldnt create.(%s)\n",fname);
return(-1);

Loading…
Cancel
Save