|
|
@ -481,7 +481,8 @@ char *LP_tradebot_buy(int32_t dispdir,char *base,char *rel,double maxprice,doubl |
|
|
|
else balance = LP_RTsmartbalance(relcoin); |
|
|
|
sum = (SATOSHIDEN*relvolume+2*dstr(txfees)) + 3 * ((SATOSHIDEN*relvolume+2*dstr(txfees))/777); |
|
|
|
printf("%s inventory balance %.8f, relvolume %.8f + txfees %.8f, utxobal %.8f sum %.8f\n",rel,dstr(abalance),relvolume,dstr(txfees),dstr(balance),dstr(sum)); |
|
|
|
if ( dstr(abalance) < relvolume && balance > sum+2*txfee ) |
|
|
|
if ( (dstr(abalance + txfees) < relvolume) || (dstr(balance - abalance) < dstr(balance - abalance + txfees)) ) |
|
|
|
//if ( dstr(abalance) < relvolume && balance > sum+2*txfee )
|
|
|
|
{ |
|
|
|
retjson = cJSON_CreateObject(); |
|
|
|
jaddstr(retjson,"error","not enough funds"); |
|
|
|