Browse Source

Test

etomic
jl777 7 years ago
parent
commit
2ac3b334cd
  1. 1
      iguana/exchanges/LP_nativeDEX.c
  2. 10
      iguana/exchanges/LP_ordermatch.c
  3. 7
      iguana/exchanges/LP_statemachine.c

1
iguana/exchanges/LP_nativeDEX.c

@ -24,6 +24,7 @@
// https://github.com/bitcoin/bips/blob/master/bip-0143.mediawiki for signing BCH/BTG // https://github.com/bitcoin/bips/blob/master/bip-0143.mediawiki for signing BCH/BTG
// //
// bugs, validations: // bugs, validations:
// remove LP_utxo_bestfit from portfolio
// portfolio value based on ask? // portfolio value based on ask?
// verify encrypted destpubkey, broadcast:0 setprice // verify encrypted destpubkey, broadcast:0 setprice

10
iguana/exchanges/LP_ordermatch.c

@ -414,7 +414,7 @@ struct LP_utxoinfo *LP_address_myutxopair(struct LP_utxoinfo *butxo,int32_t iamb
{ {
if ( (m= LP_address_utxo_ptrs(coin,iambob,utxos,max,ap,coinaddr)) > 1 ) if ( (m= LP_address_utxo_ptrs(coin,iambob,utxos,max,ap,coinaddr)) > 1 )
{ {
if ( 0 ) if ( 1 )
{ {
int32_t i; int32_t i;
for (i=0; i<m; i++) for (i=0; i<m; i++)
@ -427,7 +427,7 @@ struct LP_utxoinfo *LP_address_myutxopair(struct LP_utxoinfo *butxo,int32_t iamb
{ {
up = utxos[mini]; up = utxos[mini];
utxos[mini] = 0; utxos[mini] = 0;
//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 )
{ {
@ -435,12 +435,6 @@ struct LP_utxoinfo *LP_address_myutxopair(struct LP_utxoinfo *butxo,int32_t iamb
{ {
if ( up != 0 && (up2= utxos[mini]) != 0 ) if ( up != 0 && (up2= utxos[mini]) != 0 )
{ {
/*if ( (utxo= LP_utxoadd(1,coin->symbol,up->U.txid,up->U.vout,up->U.value,up2->U.txid,up2->U.vout,up2->U.value,coinaddr,ap->pubkey,G.gui,0,targetval)) != 0 )
{
utxo->S.satoshis = targetval;
char str[65],str2[65]; printf("butxo.%p targetval %.8f, found val %.8f %s | targetval2 %.8f val2 %.8f %s\n",utxo,dstr(targetval),dstr(up->U.value),bits256_str(str,utxo->payment.txid),dstr(targetval2),dstr(up2->U.value),bits256_str(str2,utxo->deposit.txid));
return(butxo);
}*/
LP_butxo_set(butxo,iambob,coin,up,up2,targetval); LP_butxo_set(butxo,iambob,coin,up,up2,targetval);
return(butxo); return(butxo);
} }

7
iguana/exchanges/LP_statemachine.c

@ -3039,6 +3039,13 @@ if ( (0) )
#undef aptr #undef aptr
#undef bptr #undef bptr
}*/ }*/
/*if ( (utxo= LP_utxoadd(1,coin->symbol,up->U.txid,up->U.vout,up->U.value,up2->U.txid,up2->U.vout,up2->U.value,coinaddr,ap->pubkey,G.gui,0,targetval)) != 0 )
{
utxo->S.satoshis = targetval;
char str[65],str2[65]; printf("butxo.%p targetval %.8f, found val %.8f %s | targetval2 %.8f val2 %.8f %s\n",utxo,dstr(targetval),dstr(up->U.value),bits256_str(str,utxo->payment.txid),dstr(targetval2),dstr(up2->U.value),bits256_str(str2,utxo->deposit.txid));
return(butxo);
}*/
/*if ( (sobj= jobj(v,"scriptPubKey")) != 0 ) /*if ( (sobj= jobj(v,"scriptPubKey")) != 0 )
{ {
if ( (scriptstr= jstr(sobj,"hex")) != 0 ) if ( (scriptstr= jstr(sobj,"hex")) != 0 )

Loading…
Cancel
Save