Browse Source

Trusted

etomic
jl777 7 years ago
parent
commit
90e09db879
  1. 2
      iguana/exchanges/LP_commands.c
  2. 11
      iguana/exchanges/LP_prices.c
  3. 3
      iguana/exchanges/trusted

2
iguana/exchanges/LP_commands.c

@ -376,6 +376,8 @@ dividends(coin, height, <args>)\n\
return(LP_myprices());
else if ( strcmp(method,"trust") == 0 )
return(LP_pubkey_trustset(jbits256(argjson,"pubkey"),jint(argjson,"trust")));
else if ( strcmp(method,"trusted") == 0 )
return(LP_pubkey_trusted());
}
if ( IAMLP == 0 )
{

11
iguana/exchanges/LP_prices.c

@ -221,6 +221,17 @@ char *LP_pubkey_trustset(bits256 pubkey,uint32_t trustval)
return(clonestr("{\"error\":\"pubkey not found\"}"));
}
char *LP_pubkey_trusted()
{
struct LP_pubkeyinfo *pubp,*tmp; cJSON *array = cJSON_CreateArray();
HASH_ITER(hh,LP_pubkeyinfos,pubp,tmp)
{
if ( pubp->istrusted != 0 )
jaddibits256(array,pubp->pubkey);
}
return(jprint(array,1));
}
uint64_t LP_unspents_metric(struct iguana_info *coin,char *coinaddr)
{
cJSON *array,*item; int32_t i,n; uint64_t metric=0,total;

3
iguana/exchanges/trusted

@ -0,0 +1,3 @@
#!/bin/bash
source userpass
curl --url "http://127.0.0.1:7783" --data "{\"userpass\":\"$userpass\",\"method\":\"trusted\"}"
Loading…
Cancel
Save