jl777 7 years ago
parent
commit
720f9dd2b6
  1. 4
      iguana/exchanges/LP_coins.c
  2. 1
      iguana/exchanges/LP_include.h
  3. 11
      iguana/exchanges/LP_nativeDEX.c

4
iguana/exchanges/LP_coins.c

@ -397,6 +397,7 @@ struct iguana_info *LP_coinfind(char *symbol)
struct iguana_info *LP_coincreate(cJSON *item)
{
struct iguana_info cdata,*coin=0; int32_t isPoS,longestchain = 1; uint16_t port; uint64_t txfee; double estimatedrate; uint8_t pubtype,p2shtype,wiftype; char *name=0,*symbol,*assetname=0;
printf("LP_coincreate\n");
if ( (symbol= jstr(item,"coin")) != 0 && symbol[0] != 0 && strlen(symbol) < 16 && LP_coinfind(symbol) == 0 && (port= juint(item,"rpcport")) != 0 )
{
isPoS = jint(item,"isPoS");
@ -415,6 +416,7 @@ struct iguana_info *LP_coincreate(cJSON *item)
}
else if ( (name= jstr(item,"name")) == 0 )
name = symbol;
printf("LP_coininit\n");
if ( LP_coininit(&cdata,symbol,name,assetname==0?"":assetname,isPoS,port,pubtype,p2shtype,wiftype,txfee,estimatedrate,longestchain,juint(item,"wiftaddr"),juint(item,"taddr"),LP_busport(port),jstr(item,"confpath")) < 0 )
{
coin = LP_coinadd(&cdata);
@ -436,7 +438,7 @@ struct iguana_info *LP_coincreate(cJSON *item)
}
} else coin->inactive = 0;
}
if ( 0 && coin != 0 && coin->inactive != 0 )
if ( coin != 0 && coin->inactive != 0 )
printf("LPnode.%d %s inactive.%u %p vs %p\n",IAMLP,coin->symbol,coin->inactive,assetname,name);
return(0);
}

1
iguana/exchanges/LP_include.h

@ -24,6 +24,7 @@
#ifdef FROM_JS
#include <emscripten.h>
#define sleep(x) emscripten_sleep(x)
#define usleep
#endif
//#define LP_STRICTPEERS

11
iguana/exchanges/LP_nativeDEX.c

@ -1035,10 +1035,13 @@ void LP_fromjs_iter()
char *bitcoind_RPC(char **retstrp,char *debugstr,char *url,char *userpass,char *command,char *params,int32_t timeout)
{
//char fullurl[512];
//sprintf(fullurl,"%s@%s",userpass,url);
printf("bitcoind_RPC(%s)\n",url);
return(clonestr("{\"error\":\"curl is disabled\"}"));
static uint32_t counter; char fname[512],retstr; long fsize;
sprintf(fname,"bitcoind_RPC/req.%u",counter);
counter++;
emscripten_wget(url,fname);
retstr = OS_filestr(&fsize,fname);
printf("bitcoind_RPC(%s) -> fname.(%s) %s\n",url,fname,retstr);
return(retstr);
}
#endif

Loading…
Cancel
Save