|
|
@ -275,7 +275,7 @@ struct LP_utxoinfo *LP_address_utxopair(int32_t iambob,struct LP_address_utxo ** |
|
|
|
if ( (m= LP_address_utxo_ptrs(coin,iambob,utxos,max,ap,coinaddr)) > 1 ) |
|
|
|
{ |
|
|
|
targetval = LP_basesatoshis(relvolume,price,txfee,desttxfee); |
|
|
|
if ( 1 ) |
|
|
|
if ( 0 ) |
|
|
|
{ |
|
|
|
int32_t i; |
|
|
|
for (i=0; i<m; i++) |
|
|
@ -288,7 +288,7 @@ struct LP_utxoinfo *LP_address_utxopair(int32_t iambob,struct LP_address_utxo ** |
|
|
|
up = utxos[mini]; |
|
|
|
utxos[mini] = 0; |
|
|
|
targetval2 = (targetval / 8) * 9 + 2*txfee; |
|
|
|
printf("found mini.%d %.8f for targetval %.8f -> targetval2 %.8f, ratio %.2f\n",mini,dstr(up->U.value),dstr(targetval),dstr(targetval2),(double)up->U.value/targetval); |
|
|
|
//printf("found mini.%d %.8f for targetval %.8f -> targetval2 %.8f, ratio %.2f\n",mini,dstr(up->U.value),dstr(targetval),dstr(targetval2),(double)up->U.value/targetval);
|
|
|
|
if ( (double)up->U.value/targetval < LP_MINVOL-1 ) |
|
|
|
|
|
|
|
{ |
|
|
@ -817,7 +817,7 @@ struct LP_utxoinfo *LP_ordermatch_iter(struct LP_address_utxo **utxos,int32_t ma |
|
|
|
{ |
|
|
|
uint64_t basesatoshis; struct LP_utxoinfo *bestutxo; |
|
|
|
basesatoshis = LP_basesatoshis(dstr(asatoshis),price,txfee,desttxfee); |
|
|
|
printf("basesatoshis %.8f price %.8f txfee %.8f desttxfee %.8f\n",dstr(basesatoshis),price,dstr(txfee),dstr(desttxfee)); |
|
|
|
//printf("basesatoshis %.8f price %.8f txfee %.8f desttxfee %.8f\n",dstr(basesatoshis),price,dstr(txfee),dstr(desttxfee));
|
|
|
|
if ( basesatoshis != 0 && (bestutxo= LP_address_utxopair(0,utxos,max,basecoin,coinaddr,txfee,dstr(basesatoshis)*price,price,desttxfee)) != 0 ) |
|
|
|
{ |
|
|
|
bestutxo->pubkey = pubkey; |
|
|
@ -883,12 +883,11 @@ printf("[%d/%d] %s pubcmp %d price %.8f vs maxprice %.8f asatoshis %.8f\n",i,num |
|
|
|
bitcoin_address(coinaddr,basecoin->taddr,basecoin->pubtype,pubp->rmd160,sizeof(pubp->rmd160)); |
|
|
|
asatoshis = autxo->S.satoshis; |
|
|
|
LP_listunspent_query(base,coinaddr); |
|
|
|
//LP_listunspent_both(base,coinaddr,1);
|
|
|
|
for (j=0; j<maxiters; j++) |
|
|
|
{ |
|
|
|
if ( (bestutxo= LP_ordermatch_iter(utxos,max,ordermatchpricep,bestsatoshisp,bestdestsatoshisp,basecoin,coinaddr,asatoshis,price,txfee,desttxfee,pubp->pubkey,gui)) != 0 ) |
|
|
|
{ |
|
|
|
printf("j.%d/%d ordermatch %.8f best satoshis %.8f destsatoshis %.8f txfees (%.8f %.8f)\n",j,maxiters,price,dstr(*bestsatoshisp),dstr(*bestdestsatoshisp),dstr(txfee),dstr(desttxfee)); |
|
|
|
//printf("j.%d/%d ordermatch %.8f best satoshis %.8f destsatoshis %.8f txfees (%.8f %.8f)\n",j,maxiters,price,dstr(*bestsatoshisp),dstr(*bestdestsatoshisp),dstr(txfee),dstr(desttxfee));
|
|
|
|
break; |
|
|
|
} |
|
|
|
asatoshis = (asatoshis / 64) * 63; |
|
|
|