|
|
@ -761,7 +761,7 @@ int32_t LP_tradecommand(void *ctx,char *myipaddr,int32_t pubsock,cJSON *argjson, |
|
|
|
return(retval); |
|
|
|
} |
|
|
|
price = LP_myprice(&bid,&ask,Q.srccoin,Q.destcoin); |
|
|
|
if ( (coin= LP_coinfind(Q.srccoin)) == 0 || ask <= SMALLVAL ) |
|
|
|
if ( (coin= LP_coinfind(Q.srccoin)) == 0 || price <= SMALLVAL || ask <= SMALLVAL ) |
|
|
|
{ |
|
|
|
//printf("this node has no price for %s/%s\n",Q.srccoin,Q.destcoin);
|
|
|
|
return(retval); |
|
|
@ -816,10 +816,7 @@ int32_t LP_tradecommand(void *ctx,char *myipaddr,int32_t pubsock,cJSON *argjson, |
|
|
|
//printf("call LP_utxoadd.(%s) %.8f %.8f\n",Q.coinaddr,dstr(value),dstr(value2));
|
|
|
|
if ( (butxo= LP_utxoadd(1,coin->symbol,Q.txid,Q.vout,value,Q.txid2,Q.vout2,value2,Q.coinaddr,Q.srchash,G.gui,0,Q.satoshis)) == 0 ) |
|
|
|
recalc = 1; |
|
|
|
} |
|
|
|
else |
|
|
|
{ |
|
|
|
if ( bits256_cmp(Q.txid,butxo->payment.txid) != 0 || Q.vout != butxo->payment.vout || bits256_cmp(Q.txid2,butxo->deposit.txid) != 0 || Q.vout2 != butxo->deposit.vout ) |
|
|
|
else if ( bits256_cmp(Q.txid,butxo->payment.txid) != 0 || Q.vout != butxo->payment.vout || bits256_cmp(Q.txid2,butxo->deposit.txid) != 0 || Q.vout2 != butxo->deposit.vout ) |
|
|
|
recalc = 1; |
|
|
|
} |
|
|
|
} else return(retval); |
|
|
@ -831,7 +828,7 @@ int32_t LP_tradecommand(void *ctx,char *myipaddr,int32_t pubsock,cJSON *argjson, |
|
|
|
price += (r * range); |
|
|
|
if ( price < bestprice+SMALLVAL ) |
|
|
|
return(retval); |
|
|
|
printf("recalc.%d address.(%s/%s) request.(%s)\n",recalc,Q.coinaddr,coin->smartaddr,jprint(argjson,0)); |
|
|
|
printf("recalc.%d address.(%s/%s) price %.8f request.(%s)\n",recalc,Q.coinaddr,coin->smartaddr,price,jprint(argjson,0)); |
|
|
|
if ( recalc != 0 ) |
|
|
|
{ |
|
|
|
LP_RTmetrics_update(Q.srccoin,Q.destcoin); |
|
|
|