Browse Source

Test

etomic
jl777 8 years ago
parent
commit
a5c27d5e7e
  1. 8
      iguana/exchanges/LP_ordermatch.c

8
iguana/exchanges/LP_ordermatch.c

@ -451,7 +451,11 @@ int32_t LP_nearest_utxovalue(struct iguana_info *coin,struct LP_address_utxo **u
} }
for (i=0; i<n; i++) for (i=0; i<n; i++)
{ {
if ( (up= utxos[i]) != 0 && up->spendheight == 0 ) if ( (up= utxos[i]) != 0 )
{
dist = (up->U.value - targetval);
printf("nearest i.%d target %.8f val %.8f dist %.8f mindist %.8f mini.%d spent.%d\n",i,dstr(targetval),dstr(up->U.value),dstr(dist),dstr(mindist),mini,up->spendheight);
if (up->spendheight == 0 )
{ {
if ( coin->electrum != 0 ) if ( coin->electrum != 0 )
{ {
@ -464,7 +468,6 @@ int32_t LP_nearest_utxovalue(struct iguana_info *coin,struct LP_address_utxo **u
continue; continue;
} }
} }
dist = (up->U.value - targetval);
if ( dist >= 0 && dist < mindist ) if ( dist >= 0 && dist < mindist )
{ {
printf("(%.8f %.8f %.8f).%d ",dstr(up->U.value),dstr(dist),dstr(mindist),mini); printf("(%.8f %.8f %.8f).%d ",dstr(up->U.value),dstr(dist),dstr(mindist),mini);
@ -473,6 +476,7 @@ int32_t LP_nearest_utxovalue(struct iguana_info *coin,struct LP_address_utxo **u
} }
} }
} }
}
return(mini); return(mini);
} }

Loading…
Cancel
Save