|
|
@ -1000,7 +1000,7 @@ double LP_trades_pricevalidate(struct LP_quoteinfo *qp,struct iguana_info *coin, |
|
|
|
struct LP_quoteinfo *LP_trades_gotrequest(void *ctx,struct LP_quoteinfo *qp,struct LP_quoteinfo *newqp,char *pairstr) |
|
|
|
{ |
|
|
|
int32_t voliters=10,priceiters=33; |
|
|
|
double price=0.,p=0.,qprice,myprice,bestprice,range,bid,ask; uint64_t satoshis; struct iguana_info *coin,*othercoin; struct LP_utxoinfo A,B,*autxo,*butxo; cJSON *reqjson; char str[65]; struct LP_address_utxo *utxos[4096]; int32_t i,j,r,counter,max = (int32_t)(sizeof(utxos)/sizeof(*utxos)); |
|
|
|
double price=0.,p=0.,qprice,myprice,bestprice,range,bid,ask; uint64_t satoshis; struct iguana_info *coin,*othercoin; struct LP_utxoinfo A,B,*autxo,*butxo; cJSON *reqjson; char str[65],*retstr; struct LP_address_utxo *utxos[4096]; int32_t i,j,r,counter,max = (int32_t)(sizeof(utxos)/sizeof(*utxos)); |
|
|
|
*newqp = *qp; |
|
|
|
qp = newqp; |
|
|
|
printf("bob %s received REQUEST.(%s) fill.%d gtc.%d\n",bits256_str(str,G.LP_mypub25519),qp->uuidstr+32,qp->fill,qp->gtc); |
|
|
@ -1134,10 +1134,10 @@ printf("bob %s received REQUEST.(%s) fill.%d gtc.%d\n",bits256_str(str,G.LP_mypu |
|
|
|
} |
|
|
|
else if ( qp->fill != 0 || i == priceiters ) |
|
|
|
{ |
|
|
|
printf("i.%d cant find utxopair aliceid.%llu %s/%s %.8f -> relvol %.8f\n",i,(long long)qp->aliceid,qp->srccoin,qp->destcoin,dstr(LP_basesatoshis(dstr(qp->destsatoshis),price,qp->txfee,qp->desttxfee)),dstr(qp->destsatoshis)); |
|
|
|
printf("i.%d cant find utxopair aliceid.%llu %s/%s %.8f -> relvol %.8f txfee %.8f\n",i,(long long)qp->aliceid,qp->srccoin,qp->destcoin,dstr(LP_basesatoshis(dstr(qp->destsatoshis),price,qp->txfee,qp->desttxfee)),dstr(qp->destsatoshis),dstr(qp->txfee)); |
|
|
|
if ( qp->gtc != 0 && qp->fill != 0 && coin != 0 ) |
|
|
|
{ |
|
|
|
satoshis = LP_basesatoshis(dstr(qp->destsatoshis),maxprice,qp->txfee,qp->desttxfee) + 3*txfee; |
|
|
|
satoshis = LP_basesatoshis(dstr(qp->destsatoshis),price,qp->txfee,qp->desttxfee) + 3*qp->txfee; |
|
|
|
if ( (retstr= LP_autofillbob(coin,satoshis)) != 0 ) |
|
|
|
{ |
|
|
|
printf("AUTOfill bob.(%s)\n",retstr); |
|
|
|