Browse Source

Test

pass-iguana-arg
jl777 7 years ago
parent
commit
4f57796ffa
  1. 7
      iguana/exchanges/LP_transaction.c

7
iguana/exchanges/LP_transaction.c

@ -1913,13 +1913,14 @@ char *LP_withdraw(struct iguana_info *coin,cJSON *argjson)
char *LP_autosplit(struct iguana_info *coin) char *LP_autosplit(struct iguana_info *coin)
{ {
char *retstr; cJSON *argjson,*withdrawjson,*outputs,*item; int64_t total,balance,halfval; char *retstr; cJSON *argjson,*withdrawjson,*outputs,*item; int64_t total,balance,halfval,txfee;
if ( coin->etomic[0] == 0 ) if ( coin->etomic[0] == 0 )
{ {
if ( coin->electrum != 0 ) if ( coin->electrum != 0 )
balance = LP_unspents_load(coin->symbol,coin->smartaddr); balance = LP_unspents_load(coin->symbol,coin->smartaddr);
else balance = LP_RTsmartbalance(coin); else balance = LP_RTsmartbalance(coin);
printf("%s balance %.8f\n",coin->symbol,dstr(balance)); if ( (txfee= coin->txfee) == 0 ) // BTC
txfee = LP_txfeecalc(coin,0,500);
balance -= coin->txfee - 0.001; balance -= coin->txfee - 0.001;
if ( balance > coin->txfee && balance >= 1000000 ) if ( balance > coin->txfee && balance >= 1000000 )
{ {
@ -1938,7 +1939,7 @@ char *LP_autosplit(struct iguana_info *coin)
jadd(argjson,"outputs",outputs); jadd(argjson,"outputs",outputs);
jaddnum(argjson,"broadcast",strcmp(coin->symbol,"BTC") != 0); jaddnum(argjson,"broadcast",strcmp(coin->symbol,"BTC") != 0);
jaddstr(argjson,"coin",coin->symbol); jaddstr(argjson,"coin",coin->symbol);
printf("halfval %.8f autosplit.(%s)\n",dstr(halfval),jprint(argjson,0)); //printf("halfval %.8f autosplit.(%s)\n",dstr(halfval),jprint(argjson,0));
retstr = LP_withdraw(coin,argjson); retstr = LP_withdraw(coin,argjson);
free_json(argjson); free_json(argjson);
return(retstr); return(retstr);

Loading…
Cancel
Save