Browse Source

Test

etomic
jl777 7 years ago
parent
commit
c5eeea61e3
  1. 12
      iguana/exchanges/LP_commands.c
  2. 4
      iguana/exchanges/LP_zeroconf.c

12
iguana/exchanges/LP_commands.c

@ -146,8 +146,8 @@ bot_settings(botid, newprice, newvolume)\n\
bot_status(botid)\n\
bot_stop(botid)\n\
bot_pause(botid)\n\
deposit_create(weeks, amount, broadcast=0)\n\
deposit_claim(address, expiration=0)\n\
zeroconf_deposit(weeks, amount, broadcast=0)\n\
zeroconf_claim(address, expiration=0)\n\
\"}"));
//sell(base, rel, price, basevolume, timeout=10, duration=3600)\n\
@ -184,23 +184,23 @@ deposit_claim(address, expiration=0)\n\
return(jprint(retjson,1));
}
}
else if ( strcmp(method,"deposit_create") == 0 )
else if ( strcmp(method,"zeroconf_deposit") == 0 )
{
if ( (ptr= LP_coinsearch("KMD")) != 0 )
{
if ( jint(argjson,"weeks") < 0 || jdouble(argjson,"amount") < 10. )
return(clonestr("{\"error\":\"deposit_create needs to have weeks and amount\"}"));
else return(LP_deposit_create(ptr,juint(argjson,"weeks"),jdouble(argjson,"amount"),jint(argjson,"broadcast")));
else return(LP_zeroconf_deposit(ptr,juint(argjson,"weeks"),jdouble(argjson,"amount"),jint(argjson,"broadcast")));
}
return(clonestr("{\"error\":\"cant find KMD\"}"));
}
else if ( strcmp(method,"deposit_claim") == 0 )
else if ( strcmp(method,"zeroconf_claim") == 0 )
{
if ( (ptr= LP_coinsearch("KMD")) != 0 )
{
if ( jstr(argjson,"address") == 0 )
return(clonestr("{\"error\":\"deposit_claim needs to have address\"}"));
else return(LP_deposit_claim(ptr,jstr(argjson,"address"),juint(argjson,"expiration")));
else return(LP_zeroconf_claim(ptr,jstr(argjson,"address"),juint(argjson,"expiration")));
}
return(clonestr("{\"error\":\"cant find KMD\"}"));
}

4
iguana/exchanges/LP_zeroconf.c

@ -27,7 +27,7 @@ int32_t LP_deposit_addr(char *depositaddr,uint8_t *script,uint32_t timestamp,uin
return(n);
}
char *LP_deposit_create(struct iguana_info *coin,int32_t weeks,double amount,int32_t broadcast)
char *LP_zeroconf_deposit(struct iguana_info *coin,int32_t weeks,double amount,int32_t broadcast)
{
char p2shaddr[64],*retstr,*hexstr; uint8_t script[512]; int32_t weeki,scriptlen; cJSON *argjson,*retjson,*array,*item; uint32_t timestamp; bits256 txid,sendtxid; uint64_t amount64;
if ( strcmp(coin->symbol,"KMD") != 0 )
@ -116,7 +116,7 @@ char *LP_deposit_create(struct iguana_info *coin,int32_t weeks,double amount,int
return(clonestr("{\"error\":\"error with LP_withdraw for zeroconf deposit\"}"));
}
char *LP_deposit_claim(struct iguana_info *coin,char *depositaddr,uint32_t expiration)
char *LP_zeroconf_claim(struct iguana_info *coin,char *depositaddr,uint32_t expiration)
{
static void *ctx;
uint8_t redeemscript[512],userdata[64]; char vinaddr[64],str[65],*signedtx=0; uint32_t timestamp,now,redeemlen; int32_t i,n,height,utxovout,userdatalen; bits256 signedtxid,utxotxid,sendtxid; int64_t sum,destamount,satoshis; cJSON *array,*item,*txids,*retjson;

Loading…
Cancel
Save