Browse Source

Test

etomic
jl777 8 years ago
parent
commit
0ce93141d8
  1. 7
      iguana/exchanges/LP_commands.c
  2. 1
      iguana/exchanges/LP_include.h
  3. 1
      iguana/exchanges/LP_nativeDEX.c
  4. 1
      iguana/exchanges/LP_portfolio.c
  5. 6
      iguana/exchanges/LP_utxos.c

7
iguana/exchanges/LP_commands.c

@ -251,12 +251,13 @@ trust(pubkey, trust)\n\
return(clonestr("{\"error\":\"coin is disabled\"}"));
if ( strcmp(method,"inventory") == 0 )
{
struct iguana_info *ptr; bits256 privkey,pubkey; uint8_t pubkey33[33];
struct iguana_info *ptr;
if ( (ptr= LP_coinfind(coin)) != 0 )
{
privkey = LP_privkeycalc(ctx,pubkey33,&pubkey,ptr,"",USERPASS_WIFSTR);
//privkey = LP_privkeycalc(ctx,pubkey33,&pubkey,ptr,"",USERPASS_WIFSTR);
//LP_utxopurge(0);
LP_privkey_init(-1,ptr,privkey,pubkey,pubkey33);
if ( bits256_nonz(LP_mypriv25519) != 0 )
LP_privkey_init(-1,ptr,LP_mypriv25519,LP_mypub25519);
retjson = cJSON_CreateObject();
jaddstr(retjson,"result","success");
jaddstr(retjson,"coin",coin);

1
iguana/exchanges/LP_include.h

@ -185,6 +185,7 @@ struct iguana_info
// portfolio
double price_kmd,force,perc,goal,goalperc;
uint64_t maxamount,kmd_equiv,balanceA,balanceB,valuesumA,valuesumB;
uint8_t pubkey33[33];
};
struct _LP_utxoinfo { bits256 txid; uint64_t value; int32_t vout; };

1
iguana/exchanges/LP_nativeDEX.c

@ -26,7 +26,6 @@
// unduplicated bugs:
// swap cancel should cleanly cancel
// multiple smartaddresses? enable/disable causes?
#include <stdio.h>
#include "LP_include.h"

1
iguana/exchanges/LP_portfolio.c

@ -75,6 +75,7 @@ char *LP_portfolio()
continue;
if ( iter == 0 )
{
LP_privkey_init(-1,coin,LP_mypriv25519,LP_mypub25519);
coin->balanceA = LP_balance(&coin->valuesumA,0,coin->symbol,coin->smartaddr);
coin->balanceB = LP_balance(&coin->valuesumB,1,coin->symbol,coin->smartaddr);
if ( strcmp(coin->symbol,"KMD") != 0 )

6
iguana/exchanges/LP_utxos.c

@ -775,7 +775,7 @@ int32_t LP_nearestvalue(int32_t iambob,uint64_t *values,int32_t n,uint64_t targe
return(mini);
}
uint64_t LP_privkey_init(int32_t mypubsock,struct iguana_info *coin,bits256 myprivkey,bits256 mypub,uint8_t *pubkey33)
uint64_t LP_privkey_init(int32_t mypubsock,struct iguana_info *coin,bits256 myprivkey,bits256 mypub)
{
char *script; struct LP_utxoinfo *utxo; cJSON *array,*item; bits256 txid,deposittxid; int32_t used,i,n,iambob,vout,depositvout; uint64_t *values=0,satoshis,depositval,targetval,value,total = 0;
if ( coin == 0 )
@ -878,7 +878,7 @@ bits256 LP_privkeycalc(void *ctx,uint8_t *pubkey33,bits256 *pubkeyp,struct iguan
printf("WIF.(%s) -> %s or %s?\n",wifstr,bits256_str(str,privkey),bits256_str(str2,checkkey));
}
}
bitcoin_priv2pub(ctx,pubkey33,coin->smartaddr,privkey,coin->taddr,coin->pubtype);
bitcoin_priv2pub(ctx,coin->pubkey33,coin->smartaddr,privkey,coin->taddr,coin->pubtype);
if ( coin->counter == 0 )
{
coin->counter++;
@ -927,7 +927,7 @@ void LP_privkey_updates(void *ctx,int32_t pubsock,char *passphrase,int32_t inito
if ( bits256_nonz(privkey) == 0 || coin->smartaddr[0] == 0 )
privkey = LP_privkeycalc(ctx,pubkey33,&pubkey,coin,passphrase,"");
if ( coin->inactive == 0 && initonly == 0 )
LP_privkey_init(pubsock,coin,privkey,pubkey,pubkey33);
LP_privkey_init(pubsock,coin,privkey,pubkey);
}
}

Loading…
Cancel
Save