|
|
@ -541,7 +541,7 @@ int32_t LP_utxo_clientpublish(struct LP_utxoinfo *utxo) |
|
|
|
|
|
|
|
int32_t LP_orderbook_utxoentries(uint32_t now,int32_t polarity,char *base,char *rel,struct LP_orderbookentry *(**arrayp),int32_t num,int32_t cachednum,int32_t duration) |
|
|
|
{ |
|
|
|
struct LP_utxoinfo *utxo,*tmp; struct LP_pubkeyinfo *pubp=0; struct LP_priceinfo *basepp; struct LP_orderbookentry *op; uint32_t oldest; double price; int32_t baseid,relid; uint64_t basesatoshis; |
|
|
|
struct LP_utxoinfo *utxo,*tmp; struct LP_pubkeyinfo *pubp=0; struct LP_priceinfo *basepp; struct LP_orderbookentry *op; uint32_t oldest; double price; int32_t baseid,relid; uint64_t basesatoshis,val,val2; |
|
|
|
if ( (basepp= LP_priceinfoptr(&relid,base,rel)) != 0 ) |
|
|
|
baseid = basepp->ind; |
|
|
|
else return(num); |
|
|
@ -556,6 +556,8 @@ int32_t LP_orderbook_utxoentries(uint32_t now,int32_t polarity,char *base,char * |
|
|
|
//char str[65],str2[65]; printf("check utxo.%s/v%d from %s\n",bits256_str(str,utxo->payment.txid),utxo->payment.vout,bits256_str(str2,utxo->pubkey));
|
|
|
|
if ( strcmp(base,utxo->coin) == 0 && LP_isavailable(utxo) > 0 && pubp != 0 && (price= pubp->matrix[baseid][relid]) > SMALLVAL && pubp->timestamp > oldest && pubp->timestamp <= now ) |
|
|
|
{ |
|
|
|
if ( LP_iseligible(&val,&val2,utxo->iambob,utxo->coin,utxo->payment.txid,utxo->payment.vout,utxo->S.satoshis,utxo->deposit.txid,utxo->deposit.vout) == 0 ) |
|
|
|
continue; |
|
|
|
if ( LP_orderbookfind(*arrayp,cachednum,utxo->payment.txid,utxo->payment.vout) < 0 ) |
|
|
|
{ |
|
|
|
if ( polarity > 0 ) |
|
|
|