Browse Source

Test

etomic
jl777 7 years ago
parent
commit
9fc67c9b24
  1. 4
      iguana/exchanges/LP_cache.c
  2. 1
      iguana/exchanges/LP_coins.c
  3. 3
      iguana/exchanges/LP_socket.c

4
iguana/exchanges/LP_cache.c

@ -131,6 +131,7 @@ void LP_cacheptrs_init(struct iguana_info *coin)
char fname[1024]; FILE *fp; int32_t tflag=0; long n,fsize=0,len = 0; char fname[1024]; FILE *fp; int32_t tflag=0; long n,fsize=0,len = 0;
sprintf(fname,"%s/UNSPENTS/%s.SPV",GLOBAL_DBDIR,coin->symbol), OS_portable_path(fname); sprintf(fname,"%s/UNSPENTS/%s.SPV",GLOBAL_DBDIR,coin->symbol), OS_portable_path(fname);
fp = fopen(fname,"rb"); fp = fopen(fname,"rb");
printf("load %s\n",fname);
if ( fp != 0 ) if ( fp != 0 )
{ {
fseek(fp,0,SEEK_END); fseek(fp,0,SEEK_END);
@ -145,8 +146,9 @@ void LP_cacheptrs_init(struct iguana_info *coin)
break; break;
} }
len += n; len += n;
printf("len.%ld n.%ld\n",len,n); printf("%s len.%ld n.%ld\n",fname,len,n);
} }
fclose(fp);
} else printf("couldnt find.(%s)\n",fname); } else printf("couldnt find.(%s)\n",fname);
if ( tflag != 0 ) if ( tflag != 0 )
OS_truncate(fname,len); OS_truncate(fname,len);

1
iguana/exchanges/LP_coins.c

@ -353,7 +353,6 @@ uint16_t LP_coininit(struct iguana_info *coin,char *symbol,char *name,char *asse
coin->zcash = LP_IS_BITCOINCASH; coin->zcash = LP_IS_BITCOINCASH;
//printf("set coin.%s <- LP_IS_BITCOINCASH %d\n",symbol,coin->zcash); //printf("set coin.%s <- LP_IS_BITCOINCASH %d\n",symbol,coin->zcash);
} }
LP_cacheptrs_init(coin);
return(port); return(port);
} }

3
iguana/exchanges/LP_socket.c

@ -1056,7 +1056,8 @@ cJSON *LP_electrumserver(struct iguana_info *coin,char *ipaddr,uint16_t port)
{ {
printf("launched %s electrum.(%s:%u)\n",coin->symbol,ep->ipaddr,ep->port); printf("launched %s electrum.(%s:%u)\n",coin->symbol,ep->ipaddr,ep->port);
jaddstr(retjson,"result","success"); jaddstr(retjson,"result","success");
ep->prev = coin->electrum; if ( (ep->prev= coin->electrum) == 0 )
LP_cacheptrs_init(coin);
coin->electrum = ep; coin->electrum = ep;
} }
} }

Loading…
Cancel
Save