From 3f9c935a6f125f75a457dcd3d25dad7915641948 Mon Sep 17 00:00:00 2001 From: jl777 Date: Mon, 18 Sep 2017 10:12:48 +0200 Subject: [PATCH] Test --- iguana/exchanges/LP_prices.c | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) diff --git a/iguana/exchanges/LP_prices.c b/iguana/exchanges/LP_prices.c index f0b20b3de..c39fcc898 100644 --- a/iguana/exchanges/LP_prices.c +++ b/iguana/exchanges/LP_prices.c @@ -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;