Browse Source

Test

etomic
jl777 8 years ago
parent
commit
fe11a9389a
  1. 4
      iguana/exchanges/LP_commands.c
  2. 2
      iguana/exchanges/LP_nativeDEX.c
  3. 8
      iguana/exchanges/LP_utxos.c

4
iguana/exchanges/LP_commands.c

@ -165,7 +165,7 @@ int32_t LP_tradecommand(char *myipaddr,int32_t pubsock,cJSON *argjson,uint8_t *d
if ( (method= jstr(argjson,"method")) != 0 )
{
txid = jbits256(argjson,"txid");
if ( (utxo= LP_utxofind(1,txid,jint(argjson,"vout"))) != 0 && LP_ismine(utxo) != 0 && (base= jstr(argjson,"base")) != 0 && (rel= jstr(argjson,"rel")) != 0 && strcmp(base,utxo->coin) == 0 )
if ( (utxo= LP_utxofind(1,txid,jint(argjson,"vout"))) != 0 && LP_ismine(utxo) > 0 && (base= jstr(argjson,"base")) != 0 && (rel= jstr(argjson,"rel")) != 0 && strcmp(base,utxo->coin) == 0 )
{
printf("LP_command.(%s)\n",jprint(argjson,0));
if ( (selector= LP_mempool_vinscan(&spendtxid,&spendvini,utxo->coin,utxo->payment.txid,utxo->payment.vout,utxo->deposit.txid,utxo->deposit.vout)) >= 0 )
@ -285,7 +285,7 @@ forward(pubkey,hexstr)\n\
{
HASH_ITER(hh,LP_utxoinfos[1],utxo,tmp)
{
if ( LP_ismine(utxo) != 0 && (strcmp(utxo->coin,base) == 0 || strcmp(utxo->coin,rel) == 0) )
if ( LP_ismine(utxo) > 0 && (strcmp(utxo->coin,base) == 0 || strcmp(utxo->coin,rel) == 0) )
LP_priceping(LP_mypubsock,utxo,rel,LP_profitratio - 1.);
//else printf("notmine.(%s %s)\n",utxo->coin,bits256_str(str,utxo->txid));
}

2
iguana/exchanges/LP_nativeDEX.c

@ -156,7 +156,7 @@ void LP_utxo_spentcheck(int32_t pubsock,struct LP_utxoinfo *utxo,double profitma
printf("txid2.%s %s/v%d %.8f has been spent\n",utxo->coin,bits256_str(str,u.txid),u.vout,dstr(u.value));
LP_spentnotify(utxo,1);
}
else if ( LP_ismine(utxo) != 0 )
else if ( LP_ismine(utxo) > 0 )
{
if ( strcmp(utxo->coin,"KMD") == 0 )
LP_priceping(pubsock,utxo,"BTC",profitmargin);

8
iguana/exchanges/LP_utxos.c

@ -20,10 +20,8 @@
int32_t LP_ismine(struct LP_utxoinfo *utxo)
{
if ( bits256_cmp(utxo->pubkey,LP_mypubkey) != 0 )
if ( bits256_cmp(utxo->pubkey,LP_mypubkey) == 0 )
return(1);
else if ( LP_mypeer == 0 )
return(0);
else return(0);
}
@ -263,7 +261,7 @@ char *LP_utxos(int32_t iambob,struct LP_peerinfo *mypeer,char *coin,int32_t last
{
if ( i++ < firsti )
continue;
if ( (coin == 0 || coin[0] == 0 || strcmp(coin,utxo->coin) == 0) && utxo->T.spentflag == 0 )//&& LP_ismine(utxo) != 0 )
if ( (coin == 0 || coin[0] == 0 || strcmp(coin,utxo->coin) == 0) && utxo->T.spentflag == 0 )//&& LP_ismine(utxo) > 0 )
{
jaddi(utxosjson,LP_utxojson(utxo));
}
@ -509,7 +507,7 @@ cJSON *LP_inventory(char *symbol,int32_t iambob)
HASH_ITER(hh,LP_utxoinfos[iambob],utxo,tmp)
{
//char str[65]; printf("iterate %s\n",bits256_str(str,utxo->txid));
if ( LP_isunspent(utxo) != 0 && strcmp(symbol,utxo->coin) == 0 && utxo->iambob == iambob && LP_ismine(utxo) != 0 )
if ( LP_isunspent(utxo) != 0 && strcmp(symbol,utxo->coin) == 0 && utxo->iambob == iambob && LP_ismine(utxo) > 0 )
jaddi(array,LP_inventoryjson(cJSON_CreateObject(),utxo));
}
return(array);

Loading…
Cancel
Save