Browse Source

Test

etomic
jl777 7 years ago
parent
commit
eff14be1c1
  1. 2
      iguana/exchanges/LP_commands.c
  2. 2
      iguana/exchanges/LP_include.h
  3. 13
      iguana/exchanges/LP_prices.c
  4. 4
      iguana/exchanges/LP_rpc.c

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

2
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

13
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 )

4
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 )

Loading…
Cancel
Save