jl777 8 years ago
parent
commit
31458d94c3
  1. 1
      iguana/exchanges/LP_ordermatch.c
  2. 3
      iguana/exchanges/LP_rpc.c
  3. 14
      iguana/exchanges/LP_utxos.c

1
iguana/exchanges/LP_ordermatch.c

@ -693,7 +693,6 @@ int32_t LP_tradecommand(void *ctx,char *myipaddr,int32_t pubsock,cJSON *argjson,
char *method,*msg; cJSON *retjson; double qprice,price,bid,ask; struct LP_utxoinfo A,B,*autxo,*butxo; struct LP_address_utxo **utxos; struct LP_quoteinfo Q; int32_t retval = -1,max=10000; char *method,*msg; cJSON *retjson; double qprice,price,bid,ask; struct LP_utxoinfo A,B,*autxo,*butxo; struct LP_address_utxo **utxos; struct LP_quoteinfo Q; int32_t retval = -1,max=10000;
if ( (method= jstr(argjson,"method")) != 0 && (strcmp(method,"request") == 0 ||strcmp(method,"connect") == 0) ) if ( (method= jstr(argjson,"method")) != 0 && (strcmp(method,"request") == 0 ||strcmp(method,"connect") == 0) )
{ {
//LP_requestinit(&qp->R,qp->srchash,qp->desthash,qp->srccoin,qp->satoshis-qp->txfee,qp->destcoin,qp->destsatoshis-qp->desttxfee,qp->timestamp,qp->quotetime,DEXselector);
printf("TRADECOMMAND.(%s)\n",jprint(argjson,0)); printf("TRADECOMMAND.(%s)\n",jprint(argjson,0));
retval = 1; retval = 1;
if ( LP_quoteparse(&Q,argjson) == 0 && bits256_cmp(LP_mypub25519,Q.srchash) == 0 ) if ( LP_quoteparse(&Q,argjson) == 0 && bits256_cmp(LP_mypub25519,Q.srchash) == 0 )

3
iguana/exchanges/LP_rpc.c

@ -508,8 +508,9 @@ void LP_listunspent_issue(char *symbol,char *coinaddr)
retstr = issue_LP_listunspent(destip,destport,symbol,coinaddr); retstr = issue_LP_listunspent(destip,destport,symbol,coinaddr);
if ( (retjson= cJSON_Parse(retstr)) != 0 ) if ( (retjson= cJSON_Parse(retstr)) != 0 )
{ {
if ( electrum_process_array(coin,coin->electrum,coinaddr,retjson) != 0 ) if ( electrum_process_array(coin,0,coinaddr,retjson) != 0 )
{ {
printf("PROCESS INTERNAL.(%s)\n",coin->symbol);
LP_postutxos(symbol,coinaddr); // might be good to not saturate LP_postutxos(symbol,coinaddr); // might be good to not saturate
} }
} }

14
iguana/exchanges/LP_utxos.c

@ -882,13 +882,17 @@ bits256 LP_privkeycalc(void *ctx,uint8_t *pubkey33,bits256 *pubkeyp,struct iguan
userpub = curve25519(userpass,curve25519_basepoint9()); userpub = curve25519(userpass,curve25519_basepoint9());
printf("userpass.(%s)\n",bits256_str(USERPASS,userpub)); printf("userpass.(%s)\n",bits256_str(USERPASS,userpub));
} }
if ( coin->electrum == 0 && (retjson= LP_importprivkey(coin->symbol,tmpstr,coin->smartaddr,-1)) != 0 ) if ( coin->electrum == 0 )
{ {
if ( jobj(retjson,"error") != 0 ) LP_listunspent_issue(coin->symbol,coin->smartaddr);
if ( (retjson= LP_importprivkey(coin->symbol,tmpstr,coin->smartaddr,-1)) != 0 )
{ {
printf("cant importprivkey.%s -> (%s), abort session\n",coin->symbol,jprint(retjson,1)); if ( jobj(retjson,"error") != 0 )
exit(-1); {
} printf("cant importprivkey.%s -> (%s), abort session\n",coin->symbol,jprint(retjson,1));
exit(-1);
}
} else free_json(retjson);
} }
} }
LP_mypub25519 = *pubkeyp = curve25519(privkey,curve25519_basepoint9()); LP_mypub25519 = *pubkeyp = curve25519(privkey,curve25519_basepoint9());

Loading…
Cancel
Save