diff --git a/iguana/exchanges/LP_commands.c b/iguana/exchanges/LP_commands.c index 431996de2..dba961871 100644 --- a/iguana/exchanges/LP_commands.c +++ b/iguana/exchanges/LP_commands.c @@ -453,7 +453,7 @@ instantdex_claim()\n\ LP_address(ptr,coinaddr); if ( strcmp(coinaddr,ptr->smartaddr) == 0 && bits256_nonz(G.LP_privkey) != 0 ) { - //LP_listunspent_issue(coin,coinaddr,2); + LP_listunspent_issue(coin,coinaddr,2,zero,zero); //LP_privkey_init(-1,ptr,G.LP_privkey,G.LP_mypub25519); } return(jprint(LP_listunspent(coin,coinaddr,zero,zero),1)); diff --git a/iguana/exchanges/LP_include.h b/iguana/exchanges/LP_include.h index 90e2ecf14..a61d8582a 100644 --- a/iguana/exchanges/LP_include.h +++ b/iguana/exchanges/LP_include.h @@ -27,7 +27,7 @@ #define LP_MAJOR_VERSION "0" #define LP_MINOR_VERSION "1" -#define LP_BUILD_NUMBER "17667" +#define LP_BUILD_NUMBER "17701" #define LP_BARTERDEX_VERSION 1 #define LP_MAGICBITS 1 diff --git a/iguana/exchanges/LP_prices.c b/iguana/exchanges/LP_prices.c index dfc5848a8..9c8c7f204 100644 --- a/iguana/exchanges/LP_prices.c +++ b/iguana/exchanges/LP_prices.c @@ -41,9 +41,6 @@ struct LP_priceinfo double margins[LP_MAXPRICEINFOS]; double offsets[LP_MAXPRICEINFOS]; double factors[LP_MAXPRICEINFOS]; - //double maxprices[LP_MAXPRICEINFOS]; // autofill of base/rel - //double relvols[LP_MAXPRICEINFOS]; - //FILE *fps[LP_MAXPRICEINFOS]; } LP_priceinfos[LP_MAXPRICEINFOS]; int32_t LP_numpriceinfos; @@ -503,9 +500,17 @@ int32_t LP_mypriceset(int32_t *changedp,char *base,char *rel,double price) if ( base != 0 && rel != 0 && (basepp= LP_priceinfofind(base)) != 0 && (relpp= LP_priceinfofind(rel)) != 0 ) { - if ( fabs(basepp->myprices[relpp->ind] - price)/price > 0.001 ) + if ( price == 0. || fabs(basepp->myprices[relpp->ind] - price)/price > 0.001 ) *changedp = 1; basepp->myprices[relpp->ind] = price; // ask + if ( price == 0. ) + { + relpp->minprices[basepp->ind] = 0.; + relpp->fixedprices[basepp->ind] = 0.; + relpp->margins[basepp->ind] = 0.; + relpp->offsets[basepp->ind] = 0.; + relpp->factors[basepp->ind] = 0.; + } //printf("LP_mypriceset base.%s rel.%s <- price %.8f\n",base,rel,price); //relpp->myprices[basepp->ind] = (1. / price); // bid if ( (pubp= LP_pubkeyadd(G.LP_mypub25519)) != 0 ) diff --git a/iguana/exchanges/LP_rpc.c b/iguana/exchanges/LP_rpc.c index 2c0eab7e2..4a14a5d0a 100644 --- a/iguana/exchanges/LP_rpc.c +++ b/iguana/exchanges/LP_rpc.c @@ -474,7 +474,7 @@ int64_t LP_listunspent_parseitem(struct iguana_info *coin,bits256 *txidp,int32_t int32_t LP_listunspent_issue(char *symbol,char *coinaddr,int32_t fullflag,bits256 reftxid,bits256 reftxid2) { - struct iguana_info *coin; int32_t n = 0; cJSON *retjson=0; char *retstr=0; + struct iguana_info *coin; struct LP_address *ap; int32_t n = 0; cJSON *retjson=0; char *retstr=0; if ( symbol == 0 || symbol[0] == 0 ) return(0); if ( (coin= LP_coinfind(symbol)) != 0 ) @@ -489,6 +489,8 @@ int32_t LP_listunspent_issue(char *symbol,char *coinaddr,int32_t fullflag,bits25 } else { + if ( fullflag == 2 && (ap= LP_addressfind(coin,coinaddr)) != 0 ) + ap->unspenttime = 0; retjson = LP_listunspent(symbol,coinaddr,reftxid,reftxid2); coin->numutxos = cJSON_GetArraySize(retjson); if ( retjson != 0 )