Browse Source

Test

etomic
jl777 7 years ago
parent
commit
448c0a5a0f
  1. 1
      iguana/exchanges/LP_ordermatch.c
  2. 39
      iguana/exchanges/LP_utxo.c

1
iguana/exchanges/LP_ordermatch.c

@ -813,6 +813,7 @@ int32_t LP_tradecommand(void *ctx,char *myipaddr,int32_t pubsock,cJSON *argjson,
Q.vout = butxo->payment.vout; Q.vout = butxo->payment.vout;
Q.txid2 = butxo->deposit.txid; Q.txid2 = butxo->deposit.txid;
Q.vout2 = butxo->deposit.vout; Q.vout2 = butxo->deposit.vout;
butxo->S.satoshis = Q.satoshis;
printf("set butxo.%p %s/v%d %s/v%d %.8f %.8f -> bsat %.8f asat %.8f\n",butxo,bits256_str(str,butxo->payment.txid),butxo->payment.vout,bits256_str(str2,butxo->deposit.txid),butxo->deposit.vout,dstr(butxo->payment.value),dstr(butxo->deposit.value),dstr(butxo->S.satoshis),dstr(autxo->S.satoshis)); printf("set butxo.%p %s/v%d %s/v%d %.8f %.8f -> bsat %.8f asat %.8f\n",butxo,bits256_str(str,butxo->payment.txid),butxo->payment.vout,bits256_str(str2,butxo->deposit.txid),butxo->deposit.vout,dstr(butxo->payment.value),dstr(butxo->deposit.value),dstr(butxo->S.satoshis),dstr(autxo->S.satoshis));
} }
else else

39
iguana/exchanges/LP_utxo.c

@ -812,25 +812,32 @@ int32_t LP_iseligible(uint64_t *valp,uint64_t *val2p,int32_t iambob,char *symbol
strcpy(destaddr,destaddr2); strcpy(destaddr,destaddr2);
if ( coin != 0 ) if ( coin != 0 )
{ {
if ( (tx= LP_transactionfind(coin,txid)) != 0 && vout < tx->numvouts && tx->outpoints[vout].spendheight > 0 ) if ( coin->electrum != 0 )
{ {
//printf("txid spent\n"); if ( (tx= LP_transactionfind(coin,txid)) != 0 && vout < tx->numvouts && tx->outpoints[vout].spendheight > 0 )
return(0); {
} //printf("txid spent\n");
if ( (tx= LP_transactionfind(coin,txid2)) != 0 && vout2 < tx->numvouts && tx->outpoints[vout2].spendheight > 0 ) return(0);
{ }
//printf("txid2 spent\n"); if ( (tx= LP_transactionfind(coin,txid2)) != 0 && vout2 < tx->numvouts && tx->outpoints[vout2].spendheight > 0 )
return(0); {
} //printf("txid2 spent\n");
if ( (up= LP_address_utxofind(coin,destaddr,txid,vout)) != 0 && up->spendheight > 0 ) return(0);
{ }
//printf("txid %s spentB\n",destaddr); if ( (up= LP_address_utxofind(coin,destaddr,txid,vout)) != 0 && up->spendheight > 0 )
return(0); {
//printf("txid %s spentB\n",destaddr);
return(0);
}
if ( (up= LP_address_utxofind(coin,destaddr,txid2,vout2)) != 0 && up->spendheight > 0 )
{
//printf("txid2 %s spentB\n",destaddr);
return(0);
}
} }
if ( (up= LP_address_utxofind(coin,destaddr,txid2,vout2)) != 0 && up->spendheight > 0 ) else
{ {
//printf("txid2 %s spentB\n",destaddr);
return(0);
} }
} }
return(1); return(1);

Loading…
Cancel
Save