Browse Source

Test

etomic
jl777 7 years ago
parent
commit
9e43fe9809
  1. 3
      iguana/exchanges/LP_ordermatch.c
  2. 2
      iguana/exchanges/LP_swap.c

3
iguana/exchanges/LP_ordermatch.c

@ -313,6 +313,7 @@ struct LP_utxoinfo *LP_address_utxopair(int32_t iambob,struct LP_address_utxo **
{
if ( LP_isavailable(utxo) != 0 && utxo->payment.value >= targetval && targetval >= utxo->payment.value/2 && utxo->deposit.value >= targetval2 )
{
utxo->S.satoshis = targetval;
printf("backup method found utxo!\n");
return(utxo);
}
@ -954,7 +955,7 @@ struct LP_utxoinfo *LP_buyutxo(double *ordermatchpricep,int64_t *bestsatoshisp,i
continue;
if ( LP_RTmetrics_blacklisted(pubkey) >= 0 )
continue;
printf("[%d/%d] %s pubcmp %d price %.8f vs maxprice %.8f asatoshis %.8f\n",i,numasks,jprint(item,0),bits256_cmp(pubkey,G.LP_mypub25519),price,maxprice,dstr(autxo->S.satoshis));
//printf("[%d/%d] %s pubcmp %d price %.8f vs maxprice %.8f asatoshis %.8f\n",i,numasks,jprint(item,0),bits256_cmp(pubkey,G.LP_mypub25519),price,maxprice,dstr(autxo->S.satoshis));
if ( LP_pricevalid(price) > 0 && price <= maxprice )
{
if ( bits256_nonz(destpubkey) == 0 )

2
iguana/exchanges/LP_swap.c

@ -626,7 +626,7 @@ int32_t LP_rawtx_spendscript(struct basilisk_swap *swap,int32_t height,struct ba
txfee = swap->I.Atxfee;
else txfee = LP_MIN_TXFEE;
}
if ( j64bits(vout,"satoshis") >= rawtx->I.amount-txfee && (skey= jobj(vout,"scriptPubKey")) != 0 && (hexstr= jstr(skey,"hex")) != 0 )
if ( j64bits(vout,"satoshis") >= rawtx->I.amount-2*txfee && (skey= jobj(vout,"scriptPubKey")) != 0 && (hexstr= jstr(skey,"hex")) != 0 )
{
if ( (hexlen= (int32_t)strlen(hexstr) >> 1) < sizeof(rawtx->spendscript) )
{

Loading…
Cancel
Save