jl777 7 years ago
parent
commit
0f2b98a12b
  1. 4
      iguana/exchanges/LP_ordermatch.c
  2. 9
      iguana/exchanges/LP_utxo.c

4
iguana/exchanges/LP_ordermatch.c

@ -871,7 +871,9 @@ struct LP_quoteinfo *LP_trades_gotrequest(void *ctx,struct LP_quoteinfo *qp,stru
printf("request from blacklisted %s, ignore\n",bits256_str(str,qp->desthash));
return(0);
}
printf("LP_address_utxo_reset\n");
LP_address_utxo_reset(coin);
printf("done LP_address_utxo_reset\n");
if ( (butxo= LP_address_myutxopair(butxo,1,utxos,max,LP_coinfind(qp->srccoin),qp->coinaddr,qp->txfee,dstr(qp->destsatoshis),price,qp->desttxfee)) != 0 )
{
strcpy(qp->gui,G.gui);
@ -1011,7 +1013,7 @@ void LP_tradesloop(void *ctx)
now = (uint32_t)time(NULL);
Q = qtp->Q;
funcid = qtp->funcid;
//printf("dequeue %p funcid.%d aliceid.%llu iambob.%d\n",qtp,funcid,(long long)qtp->aliceid,qtp->iambob);
printf("dequeue %p funcid.%d aliceid.%llu iambob.%d\n",qtp,funcid,(long long)qtp->aliceid,qtp->iambob);
portable_mutex_lock(&LP_tradesmutex);
DL_DELETE(LP_tradesQ,qtp);
HASH_FIND(hh,LP_trades,&qtp->aliceid,sizeof(qtp->aliceid),tp);

9
iguana/exchanges/LP_utxo.c

@ -447,9 +447,10 @@ struct LP_address *LP_address_utxo_reset(struct iguana_info *coin)
{
struct LP_address *ap; struct LP_address_utxo *up,*tmp; int32_t i,n,m,vout,height; cJSON *array,*item,*txobj; bits256 zero; int64_t value; bits256 txid; uint32_t now;
LP_address(coin,coin->smartaddr);
//printf("call listunspent issue %s (%s)\n",coin->symbol,coin->smartaddr);
printf("call listunspent issue %s (%s)\n",coin->symbol,coin->smartaddr);
memset(zero.bytes,0,sizeof(zero));
LP_listunspent_issue(coin->symbol,coin->smartaddr,2,zero,zero);
printf("back from listunspent\n");
if ( (ap= LP_addressfind(coin,coin->smartaddr)) == 0 )
{
printf("LP_address_utxo_reset: cant find address data\n");
@ -457,6 +458,7 @@ struct LP_address *LP_address_utxo_reset(struct iguana_info *coin)
}
if ( (array= LP_listunspent(coin->symbol,coin->smartaddr,zero,zero)) != 0 )
{
printf("clear ap->utxos\n");
DL_FOREACH_SAFE(ap->utxos,up,tmp)
{
portable_mutex_lock(&coin->addrmutex);
@ -467,6 +469,7 @@ struct LP_address *LP_address_utxo_reset(struct iguana_info *coin)
DL_APPEND(LP_garbage_collector2,up);
portable_mutex_unlock(&LP_gcmutex);
}
printf("done clearing ap->utxos\n");
now = (uint32_t)time(NULL);
if ( (n= cJSON_GetArraySize(array)) > 0 )
{
@ -487,10 +490,10 @@ struct LP_address *LP_address_utxo_reset(struct iguana_info *coin)
else
{
m++;
//printf("%.8f ",dstr(value));
printf("%.8f ",dstr(value));
}
}
//printf("added %d from listunspents\n",m);
printf("added %d from listunspents\n",m);
}
free_json(array);
}

Loading…
Cancel
Save