Browse Source

Test

etomic
jl777 7 years ago
parent
commit
820e8429c9
  1. 13
      iguana/exchanges/LP_commands.c
  2. 2
      iguana/exchanges/LP_nativeDEX.c
  3. 2
      iguana/exchanges/LP_ordermatch.c
  4. 2
      iguana/exchanges/LP_utxo.c

13
iguana/exchanges/LP_commands.c

@ -123,9 +123,9 @@ trust(pubkey, trust)*\n\
balance(coin, address)\n\
orderbook(base, rel, duration=3600)\n\
getprices(base, rel)\n\
sendmessage(base=coin, rel="", pubkey=zero, <argjson method2>)*\n\
getmessages(firsti=0, num=100)*\n\
deletemessages(firsti=0, num=100)*\n\
sendmessage(base=coin, rel="", pubkey=zero, <argjson method2>)\n\
getmessages(firsti=0, num=100)\n\
deletemessages(firsti=0, num=100)\n\
secretaddresses(prefix='secretaddress', passphrase, num=10, pubtype=60, taddr=0)\n\
electrum(coin, ipaddr, port)*\n\
snapshot(coin, height)\n\
@ -155,21 +155,18 @@ dividends(coin, height, <args>)\n\
{
if ( jobj(argjson,"method2") == 0 )
{
//LP_signature_add(argjson,jstr(argjson,"message"),jbits256(argjson,"pubkey"));
LP_broadcast_message(LP_mypubsock,base!=0?base:jstr(argjson,"coin"),rel,jbits256(argjson,"pubkey"),jprint(argjson,0));
}
return(clonestr("{\"result\":\"success\"}"));
}
else if ( strcmp(method,"getmessages") == 0 )
{
//*
if ( (retjson= LP_getmessages(jint(argjson,"firsti"),jint(argjson,"num"))) != 0 )
return(jprint(retjson,1));
else return(clonestr("{\"error\":\"null messages\"}"));
}
else if ( strcmp(method,"deletemessages") == 0 )
{
//*
LP_deletemessages(jint(argjson,"firsti"),jint(argjson,"num"));
return(clonestr("{\"result\":\"success\"}"));
}
@ -204,9 +201,9 @@ dividends(coin, height, <args>)\n\
price = jdouble(argjson,"price");
if ( strcmp(method,"setprice") == 0 )
{
//*
if ( price > SMALLVAL )
{
//LP_signature_add(argjson,base,rel,(uint64_t)price * SATOSHIDEN);
if ( LP_mypriceset(&changed,base,rel,price) < 0 )
return(clonestr("{\"error\":\"couldnt set price\"}"));
//else if ( LP_mypriceset(&changed,rel,base,1./price) < 0 )
@ -216,7 +213,7 @@ dividends(coin, height, <args>)\n\
}
else if ( strcmp(method,"autoprice") == 0 )
{
//*
//LP_signature_add(argjson,base,rel,(uint64_t)price * SATOSHIDEN);
if ( LP_autoprice(base,rel,price,jdouble(argjson,"margin"),jstr(argjson,"type")) < 0 )
return(clonestr("{\"error\":\"couldnt set autoprice\"}"));
else return(clonestr("{\"result\":\"success\"}"));

2
iguana/exchanges/LP_nativeDEX.c

@ -19,7 +19,7 @@
// marketmaker
//
// sign critical api calls
// SPV height errors, autodetect and fix
// -SPV height errors, autodetect and fix
// stats
// deal with offline pubkeys, reputations, etc.
// dPoW security -> 2: KMD notarized, 3: BTC notarized

2
iguana/exchanges/LP_ordermatch.c

@ -473,7 +473,7 @@ int32_t LP_nearest_utxovalue(struct iguana_info *coin,char *coinaddr,struct LP_a
LP_txheight_check(coin,coinaddr,up);
if ( oldht != up->U.height )
up->SPV = LP_merkleproof(coin,backupep,up->U.txid,up->U.height);
if ( up->SPV == -1 )
if ( up->SPV < 0 )
up->SPV = -2;
}
continue;

2
iguana/exchanges/LP_utxo.c

@ -382,7 +382,7 @@ cJSON *LP_address_utxos(struct iguana_info *coin,char *coinaddr,int32_t electrum
LP_txheight_check(coin,coinaddr,up);
if ( oldht != up->U.height )
up->SPV = LP_merkleproof(coin,backupep,up->U.txid,up->U.height);
if ( up->SPV == -1 )
if ( up->SPV < 0 )
up->SPV = -2;
}
if ( up->SPV > 0 )

Loading…
Cancel
Save