Browse Source

Test

etomic
jl777 8 years ago
parent
commit
52dbeeb431
  1. 14
      iguana/exchanges/LP_commands.c
  2. 2
      iguana/exchanges/LP_utxos.c
  3. 2
      iguana/exchanges/disable
  4. 2
      iguana/exchanges/enable

14
iguana/exchanges/LP_commands.c

@ -204,7 +204,7 @@ char *LP_connected(cJSON *argjson)
char *stats_JSON(cJSON *argjson,char *remoteaddr,uint16_t port) // from rpc port
{
char *method,*ipaddr,*userpass,*base,*rel,*coin,*retstr = 0; uint16_t argport,pushport,subport; int32_t amclient,otherpeers,othernumutxos; struct LP_utxoinfo *utxo,*tmp; struct LP_peerinfo *peer; cJSON *retjson;
char *method,*ipaddr,*userpass,*base,*rel,*coin,*retstr = 0; uint16_t argport,pushport,subport; int32_t amclient,otherpeers,othernumutxos; struct LP_utxoinfo *utxo,*tmp; struct LP_peerinfo *peer; cJSON *retjson; struct iguana_info *ptr;
if ( (method= jstr(argjson,"method")) == 0 )
return(clonestr("{\"error\":\"need method in request\"}"));
if ( USERPASS[0] != 0 && strcmp(remoteaddr,"127.0.0.1") == 0 && port != 0 )
@ -261,6 +261,18 @@ char *stats_JSON(cJSON *argjson,char *remoteaddr,uint16_t port) // from rpc port
LP_privkey_init(0,-1,coin,0,USERPASS_WIFSTR,1);
return(LP_inventory(coin));
}
else if ( strcmp(method,"enable") == 0 )
{
if ( (ptr= LP_coinsearch(coin)) != 0 )
ptr->inactive = 0;
return(jprint(LP_coins(),1));
}
else if ( strcmp(method,"disable") == 0 )
{
if ( (ptr= LP_coinsearch(coin)) != 0 )
ptr->inactive = (uint32_t)time(NULL);
return(jprint(LP_coins(),1));
}
else if ( IAMCLIENT != 0 && (strcmp(method,"candidates") == 0 || strcmp(method,"autotrade") == 0) )
{
bits256 txid; int32_t vout; struct LP_utxoinfo *utxo;

2
iguana/exchanges/LP_utxos.c

@ -477,7 +477,7 @@ void LP_privkey_updates(struct LP_peerinfo *mypeer,int32_t pubsock,char *passphr
int32_t i;
for (i=0; i<LP_numcoins; i++)
{
printf("i.%d of %d\n",i,LP_numcoins);
//printf("i.%d of %d\n",i,LP_numcoins);
LP_privkey_init(mypeer,pubsock,LP_coins[i].symbol,passphrase,"",amclient);
}
}

2
iguana/exchanges/disable

@ -0,0 +1,2 @@
source userpass
curl --url "http://127.0.0.1:7779" --data "{\"userpass\":\"$userpass\",\"method\":\"disable\",\"coin\":\"REVS\"}"

2
iguana/exchanges/enable

@ -0,0 +1,2 @@
source userpass
curl --url "http://127.0.0.1:7779" --data "{\"userpass\":\"$userpass\",\"method\":\"enable\",\"coin\":\"REVS\"}"
Loading…
Cancel
Save