Browse Source

Test

etomic
jl777 8 years ago
parent
commit
f75ffa9f2c
  1. 2
      iguana/exchanges/LP_nativeDEX.c
  2. 9
      iguana/exchanges/LP_rpc.c

2
iguana/exchanges/LP_nativeDEX.c

@ -654,7 +654,7 @@ uint64_t LP_privkey_init(struct LP_peerinfo *mypeer,int32_t mypubsock,char *symb
char tmpstr[128];
bitcoin_priv2wif(tmpstr,privkey,coin->wiftype);
printf("%s coinaddr.%s %d wif.(%s)\n",symbol,coinaddr,coin->pubtype,tmpstr);
if ( (retjson= LP_importprivkey(coin->symbol,tmpstr,-1)) != 0 )
if ( (retjson= LP_importprivkey(coin->symbol,tmpstr,coinaddr,-1)) != 0 )
printf("importprivkey -> (%s)\n",jprint(retjson,1));
}
bitcoin_addr2rmd160(&tmptype,rmd160,coinaddr);

9
iguana/exchanges/LP_rpc.c

@ -46,14 +46,11 @@ char *blocktrail_listtransactions(char *symbol,char *coinaddr,int32_t num,int32_
cJSON *bitcoin_json(struct iguana_info *coin,char *method,char *params)
{
//static void *cHandle;
char *retstr; cJSON *retjson = 0;
if ( coin != 0 )
{
printf("issue.(%s, %s, %s, %s, %s)\n",coin->symbol,coin->serverport,coin->userpass,method,params);
//retstr = curl_post(&cHandle,coin->serverport,coin->userpass,params,method,0,0,0);
//printf("issue.(%s, %s, %s, %s, %s)\n",coin->symbol,coin->serverport,coin->userpass,method,params);
retstr = bitcoind_passthru(coin->symbol,coin->serverport,coin->userpass,method,params);
//retstr = bitcoind_RPC(0,"",coin->serverport,0,method,params);
if ( retstr != 0 && retstr[0] != 0 )
{
printf("%s: %s.%s -> (%s)\n",coin->symbol,method,params,retstr);
@ -113,10 +110,10 @@ cJSON *LP_validateaddress(char *symbol,char *address)
return(bitcoin_json(coin,"validateaddress",buf));
}
cJSON *LP_importprivkey(char *symbol,char *wifstr,int32_t flag)
cJSON *LP_importprivkey(char *symbol,char *wifstr,char *label,int32_t flag)
{
char buf[512]; struct iguana_info *coin = LP_coinfind(symbol);
sprintf(buf,"[\"%s\", %s]",wifstr,flag < 0 ? "false" : "true");
sprintf(buf,"[\"%s\", \"%s\", %s]",wifstr,label,flag < 0 ? "false" : "true");
return(bitcoin_json(coin,"importprivkey",buf));
}

Loading…
Cancel
Save