Browse Source

Test

etomic
jl777 7 years ago
parent
commit
eb6db9acd1
  1. 2
      iguana/exchanges/LP_rpc.c
  2. 9
      iguana/exchanges/LP_tradebots.c

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);
}

9
iguana/exchanges/LP_tradebots.c

@ -438,17 +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,"abalance",dstr(abalance));
jaddnum(retjson,"balance",dstr(abalance));
jaddnum(retjson,"relvolume",relvolume);
jaddnum(retjson,"txfees",dstr(txfees));
shortfall = (relvolume + dstr(txfees)) - dstr(balance);
jaddnum(retjson,"shortfall",shortfall);
if ( relcoin->electrum != 0 )
balance = LP_unspents_load(relcoin->symbol,relcoin->smartaddr);
else balance = LP_RTsmartbalance(relcoin);
if ( balance > abalance+SATOSHIDEN*(shortfall+relvolume/777.) )
if ( balance > (relvolume + 10*relvolume/777.) )
{
char *withdrawstr; cJSON *outputjson,*withdrawjson,*outputs,*item;
outputjson = cJSON_CreateObject();

Loading…
Cancel
Save