jl777 7 years ago
parent
commit
7f2f2edd07
  1. 2
      iguana/exchanges/LP_ordermatch.c
  2. 6
      iguana/exchanges/LP_prices.c
  3. 1
      iguana/exchanges/LP_utxos.c

2
iguana/exchanges/LP_ordermatch.c

@ -798,7 +798,7 @@ struct LP_utxoinfo *LP_buyutxo(double *ordermatchpricep,int64_t *bestsatoshisp,i
break;
if ( j != numavoids )
continue;
if ( bits256_cmp(pubkey,G.LP_mypub25519) != 0 && (pubp= LP_pubkeyadd(pubkey)) != 0 )
if ( bits256_cmp(pubkey,G.LP_mypub25519) != 0 && (pubp= LP_pubkeyfind(pubkey)) != 0 )
{
bitcoin_address(coinaddr,basecoin->taddr,basecoin->pubtype,pubp->rmd160,sizeof(pubp->rmd160));
LP_listunspent_query(base,coinaddr);

6
iguana/exchanges/LP_prices.c

@ -504,7 +504,7 @@ int32_t LP_mypriceset(int32_t *changedp,char *base,char *rel,double price)
basepp->myprices[relpp->ind] = price; // ask
//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 )
if ( (pubp= LP_pubkeyfind(G.LP_mypub25519)) != 0 )
{
pubp->matrix[basepp->ind][relpp->ind] = price;
//pubp->matrix[relpp->ind][basepp->ind] = (1. / price);
@ -1063,7 +1063,7 @@ void LP_pricefeedupdate(bits256 pubkey,char *base,char *rel,double price)
fwrite(&price64,1,sizeof(price64),fp);
fflush(fp);
}
if ( (pubp= LP_pubkeyadd(pubkey)) != 0 )
if ( (pubp= LP_pubkeyfind(pubkey)) != 0 )
{
if ( fabs(pubp->matrix[basepp->ind][relpp->ind] - price) > SMALLVAL )
{
@ -1074,7 +1074,7 @@ void LP_pricefeedupdate(bits256 pubkey,char *base,char *rel,double price)
dxblend(&relpp->relvals[basepp->ind],1. / price,0.9);
}
pubp->timestamp = (uint32_t)time(NULL);
} else printf("error creating pubkey entry\n");
} else printf("error finding pubkey entry\n");
}
//else if ( (rand() % 100) == 0 )
// printf("error finding %s/%s %.8f\n",base,rel,price);

1
iguana/exchanges/LP_utxos.c

@ -762,6 +762,7 @@ bits256 LP_privkeycalc(void *ctx,uint8_t *pubkey33,bits256 *pubkeyp,struct iguan
checkkey.bytes[0] &= 248, checkkey.bytes[31] &= 127, checkkey.bytes[31] |= 64;
G.LP_mypub25519 = *pubkeyp = curve25519(checkkey,curve25519_basepoint9());
G.LP_mypriv25519 = checkkey;
LP_pubkeyadd(G.LP_mypub25519);
return(privkey);
}

Loading…
Cancel
Save