Browse Source

Fix native missed numconfirms

etomic
jl777 7 years ago
parent
commit
7909aed3f1
  1. 4
      iguana/exchanges/LP_nativeDEX.c
  2. 2
      iguana/exchanges/LP_ordermatch.c
  3. 5
      iguana/exchanges/LP_utxo.c

4
iguana/exchanges/LP_nativeDEX.c

@ -18,9 +18,9 @@
// LP_nativeDEX.c
// marketmaker
//
// immediate "request", actual auction
// alice waiting for bestprice
// previously, it used to show amount, kmd equiv, perc
//there is still a pending one with `-1 wait for bobpayment bYoNxkfvwQ42Yufry8J5y8BYi6mQxokvW9 numconfs.1 MNZ c0ea4aa808a653222a15122d96692fecf734dbbacfb9a54cb4711306ea0c3cef`, but that tx is already spent including 6 confirmation
// there is still a pending one with `-1 wait for bobpayment bYoNxkfvwQ42Yufry8J5y8BYi6mQxokvW9 numconfs.1 MNZ c0ea4aa808a653222a15122d96692fecf734dbbacfb9a54cb4711306ea0c3cef`, but that tx is already spent including 6 confirmation
// bot safe to exit?
//
// BCH signing

2
iguana/exchanges/LP_ordermatch.c

@ -826,7 +826,7 @@ int32_t LP_tradecommand(void *ctx,char *myipaddr,int32_t pubsock,cJSON *argjson,
{
r = (rand() % 100);
range = (qprice - price);
printf(">>>>>>>>>>>>> price %.8f qprice %.8f r.%d range %.8f -> %.8f vs bestprice %.8f\n",price,qprice,r,range,price + r*range,LP_bob_competition(aliceid,price));
printf(">>>>>>>>>>>>> price %.8f qprice %.8f r.%d range %.8f -> %.8f vs bestprice %.8f\n",price,qprice,r,range,price + (r*range)/100.,LP_bob_competition(aliceid,price));
price += (r * range) / 100.;
bestprice = LP_bob_competition(aliceid,price);
if ( price < bestprice+SMALLVAL )

5
iguana/exchanges/LP_utxo.c

@ -661,6 +661,11 @@ int32_t LP_numconfirms(char *symbol,char *coinaddr,bits256 txid,int32_t vout,int
}
else if ( mempool != 0 && LP_mempoolscan(symbol,txid) >= 0 )
numconfirms = 0;
else if ( (txobj= LP_gettx(symbol,txid)) != 0 )
{
numconfirms = jint(txobj,"confirmations");
free_json(txobj);
}
}
else
{

Loading…
Cancel
Save