Browse Source

Merge pull request #447 from jl777/spvdex

Spvdex
etomic
jl777 7 years ago
committed by GitHub
parent
commit
f8f58b4c1d
No known key found for this signature in database GPG Key ID: 4AEE18F83AFDEB23
  1. 4
      iguana/exchanges/LP_coins.c
  2. 2
      iguana/exchanges/LP_commands.c
  3. 1
      iguana/exchanges/LP_nativeDEX.c
  4. 2
      iguana/exchanges/LP_rpc.c
  5. 8
      iguana/exchanges/LP_tradebots.c

4
iguana/exchanges/LP_coins.c

@ -201,7 +201,9 @@ cJSON *LP_coinjson(struct iguana_info *coin,int32_t showwif)
if ( coin->userpass[0] != 0 )
{
jaddnum(item,"height",LP_getheight(coin));
balance = LP_RTsmartbalance(coin);
if ( coin->electrum != 0 )
balance = LP_unspents_load(coin->symbol,coin->smartaddr);
else balance = LP_RTsmartbalance(coin);
jaddnum(item,"balance",dstr(balance));
jaddnum(item,"KMDvalue",dstr(LP_KMDvalue(coin,balance)));
}

2
iguana/exchanges/LP_commands.c

@ -99,7 +99,7 @@ char *stats_JSON(void *ctx,char *myipaddr,int32_t pubsock,cJSON *argjson,char *r
available localhost RPC commands: \n \
pricearray(base, rel, starttime=0, endtime=-1, timescale=60) -> [timestamp, avebid, aveask, highbid, lowask]\n\
setprice(base, rel, price)\n\
autoprice(base, rel, minprice, margin, refbase, refrel, factor, offset)*\n\
autoprice(base, rel, fixed, minprice, margin, refbase, refrel, factor, offset)*\n\
goal(coin=*, val=<autocalc>)\n\
myprice(base, rel)\n\
enable(coin)\n\

1
iguana/exchanges/LP_nativeDEX.c

@ -18,6 +18,7 @@
// LP_nativeDEX.c
// marketmaker
//
// bot status 1600% ?
// BCH signing
// dPoW security -> 4: KMD notarized, 5: BTC notarized, after next notary elections
// bigendian architectures need to use little endian for sighash calcs

2
iguana/exchanges/LP_rpc.c

@ -1040,7 +1040,7 @@ bits256 LP_getbestblockhash(struct iguana_info *coin)
decode_hex(blockhash.bytes,sizeof(blockhash),retstr);
free(retstr);
}
}
} else printf("electrum mode doesnt support block level scanning\n");
return(blockhash);
}

8
iguana/exchanges/LP_tradebots.c

@ -438,14 +438,18 @@ char *LP_tradebot_buy(int32_t dispdir,char *base,char *rel,double maxprice,doubl
if ( dstr(abalance) < relvolume + dstr(txfees) )
{
retjson = cJSON_CreateObject();
if ( relcoin->electrum != 0 )
balance = LP_unspents_load(relcoin->symbol,relcoin->smartaddr);
else balance = LP_RTsmartbalance(relcoin);
jaddstr(retjson,"error","not enough funds");
jaddstr(retjson,"coin",rel);
jaddnum(retjson,"balance",dstr(abalance));
jaddnum(retjson,"abalance",dstr(abalance));
jaddnum(retjson,"balance",dstr(balance));
jaddnum(retjson,"relvolume",relvolume);
jaddnum(retjson,"txfees",dstr(txfees));
shortfall = (relvolume + dstr(txfees)) - dstr(balance);
jaddnum(retjson,"shortfall",shortfall);
if ( (balance= LP_RTsmartbalance(relcoin)) > abalance+SATOSHIDEN*(shortfall+relvolume/77.) )
if ( balance > (relvolume + 10*relvolume/777.) )
{
char *withdrawstr; cJSON *outputjson,*withdrawjson,*outputs,*item;
outputjson = cJSON_CreateObject();

Loading…
Cancel
Save