|
|
@ -1031,11 +1031,26 @@ void LPinit(uint16_t myport,uint16_t mypullport,uint16_t mypubport,uint16_t mybu |
|
|
|
} |
|
|
|
|
|
|
|
#ifdef FROM_JS |
|
|
|
extern void *Nanomsg_threadarg; |
|
|
|
|
|
|
|
void emscripten_usleep(int32_t x) |
|
|
|
{ |
|
|
|
} |
|
|
|
|
|
|
|
char *bitcoind_RPC(char **retstrp,char *debugstr,char *url,char *userpass,char *command,char *params,int32_t timeout) |
|
|
|
{ |
|
|
|
static uint32_t counter; char fname[512],*retstr; long fsize; |
|
|
|
if ( strncmp("http://",url,strlen("http://")) != 0 ) |
|
|
|
return(clonestr("{\"error\":\"only http allowed\"}")); |
|
|
|
sprintf(fname,"bitcoind_RPC/req.%u",counter); |
|
|
|
counter++; |
|
|
|
//printf("issue.(%s)\n",url);
|
|
|
|
emscripten_wget(url,fname); |
|
|
|
retstr = OS_filestr(&fsize,fname); |
|
|
|
//printf("bitcoind_RPC(%s) -> fname.(%s) %s\n",url,fname,retstr);
|
|
|
|
return(retstr); |
|
|
|
} |
|
|
|
|
|
|
|
void LP_fromjs_iter() |
|
|
|
{ |
|
|
|
static void *ctx; |
|
|
@ -1048,6 +1063,8 @@ void LP_fromjs_iter() |
|
|
|
ctx = bitcoin_ctx(); |
|
|
|
if ( 0 && (LP_counter % 100) == 0 ) |
|
|
|
printf("LP_fromjs_iter got called LP_counter.%d userpass.(%s) ctx.%p\n",LP_counter,G.USERPASS,ctx); |
|
|
|
if ( Nanomsg_threadarg != 0 ) |
|
|
|
nn_thread_main_routine(Nanomsg_threadarg); |
|
|
|
LP_pubkeys_query(); |
|
|
|
LP_utxosQ_process(); |
|
|
|
LP_nanomsg_recvs(ctx); |
|
|
@ -1055,20 +1072,6 @@ void LP_fromjs_iter() |
|
|
|
LP_counter++; |
|
|
|
} |
|
|
|
|
|
|
|
char *bitcoind_RPC(char **retstrp,char *debugstr,char *url,char *userpass,char *command,char *params,int32_t timeout) |
|
|
|
{ |
|
|
|
static uint32_t counter; char fname[512],*retstr; long fsize; |
|
|
|
if ( strncmp("http://",url,strlen("http://")) != 0 ) |
|
|
|
return(clonestr("{\"error\":\"only http allowed\"}")); |
|
|
|
sprintf(fname,"bitcoind_RPC/req.%u",counter); |
|
|
|
counter++; |
|
|
|
//printf("issue.(%s)\n",url);
|
|
|
|
emscripten_wget(url,fname); |
|
|
|
retstr = OS_filestr(&fsize,fname); |
|
|
|
//printf("bitcoind_RPC(%s) -> fname.(%s) %s\n",url,fname,retstr);
|
|
|
|
return(retstr); |
|
|
|
} |
|
|
|
|
|
|
|
#endif |
|
|
|
|
|
|
|
|
|
|
|