Browse Source

Test

etomic
jl777 7 years ago
parent
commit
eefb5e2aa2
  1. 4
      iguana/exchanges/LP_coins.c
  2. 4
      iguana/exchanges/LP_commands.c
  3. 1
      iguana/exchanges/LP_include.h
  4. 4
      iguana/exchanges/LP_instantdex.c
  5. 8
      iguana/exchanges/LP_nativeDEX.c

4
iguana/exchanges/LP_coins.c

@ -214,7 +214,7 @@ uint16_t LP_userpass(char *userpass,char *symbol,char *assetname,char *confroot,
cJSON *LP_coinjson(struct iguana_info *coin,int32_t showwif)
{
struct electrum_info *ep; int32_t notarized; uint64_t balance; char wifstr[128],ipaddr[64]; uint8_t tmptype; bits256 checkkey; cJSON *item = cJSON_CreateObject();
struct electrum_info *ep; bits256 zero; int32_t notarized; uint64_t balance; char wifstr[128],ipaddr[64]; uint8_t tmptype; bits256 checkkey; cJSON *item = cJSON_CreateObject();
jaddstr(item,"coin",coin->symbol);
if ( showwif != 0 )
{
@ -261,6 +261,8 @@ cJSON *LP_coinjson(struct iguana_info *coin,int32_t showwif)
jaddnum(item,"txfee",strcmp(coin->symbol,"BTC") != 0 ? coin->txfee : LP_txfeecalc(coin,0,0));
if ( strcmp(coin->symbol,"KMD") == 0 )
{
memset(zero.bytes,0,sizeof(zero));
LP_instantdex_depositadd(coin->smartaddr,zero);
jaddnum(item,"zcredits",dstr(LP_myzcredits()));
jadd(item,"zdebits",LP_myzdebits());
}

4
iguana/exchanges/LP_commands.c

@ -184,7 +184,7 @@ instantdex_claim()\n\
jdelete(argjson,"userpass");
if ( strcmp(method,"passphrase") == 0 )
{
char coinaddr[64]; bits256 zero;
char coinaddr[64];
G.USERPASS_COUNTER = 1;
if ( LP_passphrase_init(jstr(argjson,"passphrase"),jstr(argjson,"gui")) < 0 )
return(clonestr("{\"error\":\"couldnt change passphrase\"}"));
@ -195,8 +195,6 @@ instantdex_claim()\n\
jaddbits256(retjson,"mypubkey",G.LP_mypub25519);
bitcoin_address(coinaddr,0,60,G.LP_myrmd160,20);
jaddstr(retjson,"KMD",coinaddr);
memset(zero.bytes,0,sizeof(zero));
LP_instantdex_depositadd(coinaddr,zero);
bitcoin_address(coinaddr,0,0,G.LP_myrmd160,20);
jaddstr(retjson,"BTC",coinaddr);
jaddstr(retjson,"NXT",G.LP_NXTaddr);

1
iguana/exchanges/LP_include.h

@ -506,6 +506,7 @@ int32_t iguana_signrawtransaction(void *ctx,char *symbol,uint8_t wiftaddr,uint8_
//void LP_butxo_swapfields_set(struct LP_utxoinfo *butxo);
struct LP_address_utxo *LP_address_utxofind(struct iguana_info *coin,char *coinaddr,bits256 txid,int32_t vout);
int64_t LP_myzcredits();
void LP_instantdex_depositadd(char *coinaddr,bits256 txid);
int32_t LP_destaddr(char *destaddr,cJSON *item);
int32_t LP_waitmempool(char *symbol,char *coinaddr,bits256 txid,int32_t vout,int32_t duration);
cJSON *LP_statslog_disp(uint32_t starttime,uint32_t endtime,char *refgui,bits256 refpubkey,char *refbase,char *refrel);

4
iguana/exchanges/LP_instantdex.c

@ -68,7 +68,7 @@ void LP_instantdex_deposituniq(FILE *fp,bits256 txid)
fread(&prevtxid,1,sizeof(prevtxid),fp);
if ( bits256_cmp(prevtxid,txid) == 0 )
{
printf("%s duplicate of deposits[%d]\n",bits256_str(str,prevtxid),i);
//printf("%s duplicate of deposits[%d]\n",bits256_str(str,prevtxid),i);
break;
}
}
@ -133,7 +133,7 @@ void LP_instantdex_depositadd(char *coinaddr,bits256 txid)
for (i=0; i<n; i++)
{
prevtxid = jbits256i(array,i);
printf("instantdex iter.%d i.%d check %s\n",iter,i,bits256_str(str,prevtxid));
//printf("instantdex iter.%d i.%d check %s\n",iter,i,bits256_str(str,prevtxid));
if ( (txobj= LP_gettxout("KMD",coinaddr,prevtxid,0)) != 0 )
free_json(txobj);
else

8
iguana/exchanges/LP_nativeDEX.c

@ -1162,10 +1162,10 @@ void LPinit(uint16_t myport,uint16_t mypullport,uint16_t mypubport,uint16_t mybu
LP_initcoins(ctx,pubsock,coinsjson);
G.waiting = 1;
LP_passphrase_init(passphrase,jstr(argjson,"gui"));
char coinaddr[64]; bits256 zero;
bitcoin_address(coinaddr,0,60,G.LP_myrmd160,20);
memset(zero.bytes,0,sizeof(zero));
LP_instantdex_depositadd(coinaddr,zero);
//char coinaddr[64]; bits256 zero;
//bitcoin_address(coinaddr,0,60,G.LP_myrmd160,20);
//memset(zero.bytes,0,sizeof(zero));
//LP_instantdex_depositadd(coinaddr,zero);
#ifndef FROM_JS
if ( IAMLP != 0 && OS_thread_create(malloc(sizeof(pthread_t)),NULL,(void *)LP_psockloop,(void *)myipaddr) != 0 )
{

Loading…
Cancel
Save