Browse Source

Test

etomic
jl777 8 years ago
parent
commit
660d65d086
  1. 16
      iguana/exchanges/LP_coins.c

16
iguana/exchanges/LP_coins.c

@ -182,7 +182,7 @@ cJSON *LP_coinsjson()
return(array); return(array);
} }
void LP_coininit(struct iguana_info *coin,char *symbol,char *name,char *assetname,int32_t isPoS,uint16_t port,uint8_t pubtype,uint8_t p2shtype,uint8_t wiftype,uint64_t txfee,double estimatedrate,int32_t longestchain,uint8_t taddr) int32_t LP_coininit(struct iguana_info *coin,char *symbol,char *name,char *assetname,int32_t isPoS,uint16_t port,uint8_t pubtype,uint8_t p2shtype,uint8_t wiftype,uint64_t txfee,double estimatedrate,int32_t longestchain,uint8_t taddr)
{ {
char *name2; char *name2;
memset(coin,0,sizeof(*coin)); memset(coin,0,sizeof(*coin));
@ -200,7 +200,7 @@ void LP_coininit(struct iguana_info *coin,char *symbol,char *name,char *assetnam
if ( strcmp(symbol,"KMD") == 0 || (assetname != 0 && assetname[0] != 0) ) if ( strcmp(symbol,"KMD") == 0 || (assetname != 0 && assetname[0] != 0) )
name2 = 0; name2 = 0;
else name2 = name; else name2 = name;
LP_userpass(coin->userpass,symbol,assetname,name,name2); return(LP_userpass(coin->userpass,symbol,assetname,name,name2));
} }
struct iguana_info *LP_coinadd(struct iguana_info *cdata) struct iguana_info *LP_coinadd(struct iguana_info *cdata)
@ -259,9 +259,11 @@ struct iguana_info *LP_coinfind(char *symbol)
else if ( strcmp(symbol,"KMD") == 0 ) else if ( strcmp(symbol,"KMD") == 0 )
name = "komodo"; name = "komodo";
else return(0); else return(0);
LP_coininit(&cdata,symbol,name,assetname,isPoS,port,pubtype,p2shtype,wiftype,txfee,estimatedrate,longestchain,0); if ( LP_coininit(&cdata,symbol,name,assetname,isPoS,port,pubtype,p2shtype,wiftype,txfee,estimatedrate,longestchain,0) > 0 )
if ( (coin= LP_coinadd(&cdata)) != 0 && strcmp(symbol,"KMD") == 0 ) {
coin->inactive = 0; if ( (coin= LP_coinadd(&cdata)) != 0 && strcmp(symbol,"KMD") == 0 )
coin->inactive = 0;
}
return(coin); return(coin);
} }
@ -288,8 +290,8 @@ struct iguana_info *LP_coincreate(cJSON *item)
name = assetname; name = assetname;
else if ( (name= jstr(item,"name")) == 0 ) else if ( (name= jstr(item,"name")) == 0 )
name = symbol; name = symbol;
LP_coininit(&cdata,symbol,name,assetname==0?"":assetname,isPoS,port,pubtype,p2shtype,wiftype,txfee,estimatedrate,longestchain,jint(item,"taddr")); if ( LP_coininit(&cdata,symbol,name,assetname==0?"":assetname,isPoS,port,pubtype,p2shtype,wiftype,txfee,estimatedrate,longestchain,jint(item,"taddr")) > 0 )
coin = LP_coinadd(&cdata); coin = LP_coinadd(&cdata);
} }
if ( coin != 0 && item != 0 ) if ( coin != 0 && item != 0 )
{ {

Loading…
Cancel
Save