Browse Source

Test

etomic
jl777 8 years ago
parent
commit
e67c08d195
  1. 6
      iguana/exchanges/LP_ordermatch.c
  2. 2
      iguana/exchanges/LP_utxo.c

6
iguana/exchanges/LP_ordermatch.c

@ -478,7 +478,7 @@ int32_t LP_nearest_utxovalue(struct iguana_info *coin,char *coinaddr,struct LP_a
continue; continue;
} //else printf("%s %s: SPV.%d\n",coin->symbol,bits256_str(str,up->U.txid),up->SPV); } //else printf("%s %s: SPV.%d\n",coin->symbol,bits256_str(str,up->U.txid),up->SPV);
} }
if ( up->SPV > 0 && dist >= 0 && dist < mindist ) if ( (coin->electrum == 0 || up->SPV > 0) && 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);
mini = i; mini = i;
@ -507,7 +507,7 @@ struct LP_utxoinfo *LP_address_utxopair(int32_t iambob,struct LP_address_utxo **
if ( (m= LP_address_utxo_ptrs(iambob,utxos,max,ap,coinaddr)) > 1 ) if ( (m= LP_address_utxo_ptrs(iambob,utxos,max,ap,coinaddr)) > 1 )
{ {
targetval = LP_basesatoshis(relvolume,price,txfee,desttxfee); targetval = LP_basesatoshis(relvolume,price,txfee,desttxfee);
if ( 1 ) if ( 0 )
{ {
int32_t i; int32_t i;
for (i=0; i<m; i++) for (i=0; i<m; i++)
@ -520,7 +520,7 @@ struct LP_utxoinfo *LP_address_utxopair(int32_t iambob,struct LP_address_utxo **
up = utxos[mini]; up = utxos[mini];
utxos[mini] = 0; utxos[mini] = 0;
targetval2 = (targetval / 8) * 9 + 2*txfee; 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 ) if ( (double)up->U.value/targetval < LP_MINVOL-1 )
{ {

2
iguana/exchanges/LP_utxo.c

@ -242,7 +242,7 @@ int32_t LP_address_utxoadd(struct iguana_info *coin,char *coinaddr,bits256 txid,
DL_APPEND(ap->utxos,up); DL_APPEND(ap->utxos,up);
portable_mutex_unlock(&coin->addrmutex); portable_mutex_unlock(&coin->addrmutex);
retval = 1; retval = 1;
if ( 1 && height > 0 && strcmp("REVS",coin->symbol) == 0 ) if ( 0 && height > 0 && strcmp("REVS",coin->symbol) == 0 )
printf("ADD UTXO >> %s %s %s/v%d ht.%d %.8f\n",coin->symbol,coinaddr,bits256_str(str,txid),vout,height,dstr(value)); printf("ADD UTXO >> %s %s %s/v%d ht.%d %.8f\n",coin->symbol,coinaddr,bits256_str(str,txid),vout,height,dstr(value));
} }
} // else printf("cant get ap %s %s\n",coin->symbol,coinaddr); } // else printf("cant get ap %s %s\n",coin->symbol,coinaddr);

Loading…
Cancel
Save