Browse Source

Test

etomic
jl777 8 years ago
parent
commit
c29f998292
  1. 1
      basilisk/jumblr.c
  2. 10
      iguana/exchanges/LP_coins.c
  3. 20
      iguana/exchanges/LP_commands.c

1
basilisk/jumblr.c

@ -648,6 +648,7 @@ void jumblr_iteration(struct supernet_info *myinfo,struct iguana_info *coin,int3
fee = JUMBLR_INCR * JUMBLR_FEE;
OS_randombytes(&r,sizeof(r));
//r = 0;
// randomize size chosen and order of chunks
if ( strcmp(coin->symbol,"KMD") == 0 && coin->FULLNODE < 0 )
{
//printf("JUMBLR selector.%d modval.%d r.%d\n",selector,modval,r&7);

10
iguana/exchanges/LP_coins.c

@ -208,6 +208,16 @@ struct iguana_info *LP_coinsearch(char *symbol)
return(0);
}
int32_t LP_isdisabled(char *base,char *rel)
{
struct iguana_info *coin;
if ( base != 0 && (coin= LP_coinsearch(base)) != 0 && coin->inactive != 0 )
return(1);
else if ( rel != 0 && (coin= LP_coinsearch(rel)) != 0 && coin->inactive != 0 )
return(1);
else return(0);
}
struct iguana_info *LP_coinfind(char *symbol)
{
struct iguana_info *coin,cdata; int32_t isPoS,longestchain = 1000000; uint16_t port; uint64_t txfee; double estimatedrate; uint8_t pubtype,p2shtype,wiftype; char *name,*assetname;

20
iguana/exchanges/LP_commands.c

@ -222,6 +222,8 @@ char *stats_JSON(cJSON *argjson,char *remoteaddr,uint16_t port) // from rpc port
if ( (base= jstr(argjson,"base")) != 0 && (rel= jstr(argjson,"rel")) != 0 )
{
//char str[65];
if ( LP_isdisabled(base,rel) != 0 )
return(clonestr("{\"error\":\"at least one of coins disabled\"}"));
if ( strcmp(method,"setprice") == 0 )
{
if ( LP_mypriceset(base,rel,jdouble(argjson,"price")) < 0 )
@ -256,12 +258,7 @@ char *stats_JSON(cJSON *argjson,char *remoteaddr,uint16_t port) // from rpc port
}
else if ( (coin= jstr(argjson,"coin")) != 0 )
{
if ( strcmp(method,"inventory") == 0 )
{
LP_privkey_init(0,-1,coin,0,USERPASS_WIFSTR,1);
return(LP_inventory(coin));
}
else if ( strcmp(method,"enable") == 0 )
if ( strcmp(method,"enable") == 0 )
{
if ( (ptr= LP_coinsearch(coin)) != 0 )
ptr->inactive = 0;
@ -273,6 +270,13 @@ char *stats_JSON(cJSON *argjson,char *remoteaddr,uint16_t port) // from rpc port
ptr->inactive = (uint32_t)time(NULL);
return(jprint(LP_coinsjson(),1));
}
if ( LP_isdisabled(coin,0) != 0 )
return(clonestr("{\"error\":\"coin is disabled\"}"));
if ( strcmp(method,"inventory") == 0 )
{
LP_privkey_init(0,-1,coin,0,USERPASS_WIFSTR,1);
return(LP_inventory(coin));
}
else if ( IAMCLIENT != 0 && (strcmp(method,"candidates") == 0 || strcmp(method,"autotrade") == 0) )
{
bits256 txid; int32_t vout; struct LP_utxoinfo *utxo;
@ -297,6 +301,10 @@ char *stats_JSON(cJSON *argjson,char *remoteaddr,uint16_t port) // from rpc port
else return(basilisk_swaplist());
}
}
if ( LP_isdisabled(jstr(argjson,"base"),jstr(argjson,"base")) != 0 )
return(clonestr("{\"error\":\"at least one of coins disabled\"}"));
if ( LP_isdisabled(jstr(argjson,"coin"),0) != 0 )
return(clonestr("{\"error\":\"coin is disabled\"}"));
amclient = (LP_mypeer == 0);
if ( (ipaddr= jstr(argjson,"ipaddr")) != 0 && (argport= juint(argjson,"port")) != 0 )
{

Loading…
Cancel
Save