|
|
@ -575,7 +575,7 @@ struct LP_orderbookentry *LP_orderbookentry(char *address,char *base,char *rel,d |
|
|
|
|
|
|
|
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) |
|
|
|
{ |
|
|
|
char coinaddr[64]; struct LP_pubkeyinfo *pubp=0,*tmp; struct LP_priceinfo *basepp; struct LP_orderbookentry *op; struct LP_address *ap; struct iguana_info *basecoin; uint32_t oldest; double price; int32_t baseid,relid,n; uint64_t basesatoshis,maxsatoshis; |
|
|
|
char coinaddr[64]; uint8_t zeroes[20]; struct LP_pubkeyinfo *pubp=0,*tmp; struct LP_priceinfo *basepp; struct LP_orderbookentry *op; struct LP_address *ap; struct iguana_info *basecoin; uint32_t oldest; double price; int32_t baseid,relid,n; uint64_t basesatoshis,maxsatoshis; |
|
|
|
if ( (basepp= LP_priceinfoptr(&relid,base,rel)) != 0 ) |
|
|
|
baseid = basepp->ind; |
|
|
|
else return(num); |
|
|
@ -583,9 +583,12 @@ int32_t LP_orderbook_utxoentries(uint32_t now,int32_t polarity,char *base,char * |
|
|
|
return(-1); |
|
|
|
now = (uint32_t)time(NULL); |
|
|
|
oldest = now - duration; |
|
|
|
memset(zeroes,0,sizeof(zeroes)); |
|
|
|
HASH_ITER(hh,LP_pubkeyinfos,pubp,tmp) |
|
|
|
{ |
|
|
|
if ( pubp->timestamp < oldest ) |
|
|
|
//if ( pubp->timestamp < oldest )
|
|
|
|
// continue;
|
|
|
|
if ( memcmp(zeroes,pubp->rmd160,sizeof(pubp->rmd160)) == 0 ) |
|
|
|
continue; |
|
|
|
bitcoin_address(coinaddr,basecoin->taddr,basecoin->pubtype,pubp->rmd160,sizeof(pubp->rmd160)); |
|
|
|
basesatoshis = maxsatoshis = 0; |
|
|
|