Browse Source

Prevent auto split for etomics

jl777
jl777 7 years ago
parent
commit
91b84b468f
  1. 17
      iguana/exchanges/LP_ordermatch.c
  2. 4
      iguana/exchanges/LP_utxo.c
  3. 2
      iguana/exchanges/coins

17
iguana/exchanges/LP_ordermatch.c

@ -1483,15 +1483,20 @@ char *LP_autobuy(void *ctx,int32_t fomoflag,char *myipaddr,int32_t mypubsock,cha
jaddnum(retjson,"wait",Alice_expiration-time(NULL));
return(jprint(retjson,1));
} else LP_alicequery_clear();
LP_address_utxo_reset(&num,relcoin);
if ( num <= 1 )
if ( relcoin->etomic[0] != 0 )
LP_address_utxo_reset(&num,LP_coinfind("ETOMIC"));
else
{
if ( time(NULL) > relcoin->lastautosplit+300 )
LP_address_utxo_reset(&num,relcoin);
if ( num <= 1 )
{
relcoin->lastautosplit = (uint32_t)time(NULL);
return(LP_autosplit(relcoin));
if ( time(NULL) > relcoin->lastautosplit+300 )
{
relcoin->lastautosplit = (uint32_t)time(NULL);
return(LP_autosplit(relcoin));
}
return(clonestr("{\"error\":\"not enough utxo, please make more deposits\"}"));
}
return(clonestr("{\"error\":\"not enough utxo, please make more deposits\"}"));
}
LP_txfees(&txfee,&desttxfee,base,rel);
if ( txfee != 0 && txfee < 10000 )

4
iguana/exchanges/LP_utxo.c

@ -519,9 +519,11 @@ int32_t LP_address_utxoadd(int32_t skipsearch,uint32_t timestamp,char *debug,str
struct LP_address *LP_address_utxo_reset(int32_t *nump,struct iguana_info *coin)
{
struct LP_address *ap; struct LP_address_utxo *up,*tmp; int32_t i,n,numconfs,m,vout,height; cJSON *array,*item,*txobj; bits256 zero; int64_t value; bits256 txid; uint32_t now;
*nump = 0;
if ( coin == 0 )
return(0);
LP_address(coin,coin->smartaddr);
memset(zero.bytes,0,sizeof(zero));
*nump = 0;
LP_listunspent_issue(coin->symbol,coin->smartaddr,2,zero,zero);
if ( (ap= LP_addressfind(coin,coin->smartaddr)) == 0 )
{

2
iguana/exchanges/coins

File diff suppressed because one or more lines are too long
Loading…
Cancel
Save