jl777 8 years ago
parent
commit
c356f45b27
  1. 3
      iguana/exchanges/LP_ordermatch.c
  2. 2
      iguana/exchanges/LP_socket.c

3
iguana/exchanges/LP_ordermatch.c

@ -706,6 +706,7 @@ int32_t LP_tradecommand(void *ctx,char *myipaddr,int32_t pubsock,cJSON *argjson,
price = ask;
autxo = &A;
butxo = &B;
LP_abutxo_set(autxo,0,&Q);
if ( strcmp(method,"request") == 0 )
{
utxos = calloc(max,sizeof(*utxos));
@ -721,7 +722,7 @@ int32_t LP_tradecommand(void *ctx,char *myipaddr,int32_t pubsock,cJSON *argjson,
Q.vout = butxo->payment.vout;
Q.txid2 = butxo->deposit.txid;
Q.vout2 = butxo->deposit.vout;
LP_abutxo_set(autxo,butxo,&Q);
LP_abutxo_set(0,butxo,&Q);
LP_butxo_swapfields(butxo);
if ( (qprice= LP_quote_validate(autxo,butxo,&Q,1)) <= SMALLVAL )
{

2
iguana/exchanges/LP_socket.c

@ -467,7 +467,7 @@ cJSON *electrum_address_getmempool(char *symbol,struct electrum_info *ep,cJSON *
cJSON *electrum_address_listunspent(char *symbol,struct electrum_info *ep,cJSON **retjsonp,char *addr)
{
cJSON *retjson=0; struct iguana_info *coin = LP_coinfind(symbol);
printf("electrum.%s/%s listunspent last.(%s lag %d)\n",ep->symbol,coin->symbol,coin->lastunspent,(int32_t)(time(NULL) - coin->unspenttime));
//printf("electrum.%s/%s listunspent last.(%s lag %d)\n",ep->symbol,coin->symbol,coin->lastunspent,(int32_t)(time(NULL) - coin->unspenttime));
if ( strcmp(coin->lastunspent,addr) != 0 || time(NULL) > coin->unspenttime+10 )
{
if ( (retjson= electrum_strarg(symbol,ep,retjsonp,"blockchain.address.listunspent",addr,ELECTRUM_TIMEOUT)) != 0 )

Loading…
Cancel
Save