From 32704381dd8ec17461a15af71ec206183b7f26dd Mon Sep 17 00:00:00 2001 From: jl777 Date: Sat, 30 Sep 2017 14:42:49 +0300 Subject: [PATCH] Test --- iguana/exchanges/LP_utxo.c | 24 +++++++++++++++++------- 1 file changed, 17 insertions(+), 7 deletions(-) diff --git a/iguana/exchanges/LP_utxo.c b/iguana/exchanges/LP_utxo.c index 4eaaece84..32e7d5df1 100644 --- a/iguana/exchanges/LP_utxo.c +++ b/iguana/exchanges/LP_utxo.c @@ -121,20 +121,30 @@ int32_t LP_address_minmax(uint64_t *minp,uint64_t *maxp,struct LP_address *ap) return(n); } -struct LP_utxoinfo *LP_unallocated(int32_t iambob,bits256 txid,int32_t vout) +struct LP_utxoinfo *LP_unallocated(bits256 txid,int32_t vout) { struct LP_utxoinfo *utxo; - if ( (utxo= _LP_utxofind(iambob,txid,vout)) != 0 && LP_isavailable(utxo) == 0 ) + if ( (utxo= _LP_utxofind(0,txid,vout)) != 0 && LP_isavailable(utxo) == 0 ) { char str[65]; printf("%s/v%d not available\n",bits256_str(str,txid),vout); - return(0); + return(utxo); } - if ( (utxo= _LP_utxo2find(iambob,txid,vout)) != 0 && LP_isavailable(utxo) == 0 ) + if ( (utxo= _LP_utxo2find(0,txid,vout)) != 0 && LP_isavailable(utxo) == 0 ) { char str[65]; printf("%s/v%d not available2\n",bits256_str(str,txid),vout); - return(0); + return(utxo); } - return(utxo); + if ( (utxo= _LP_utxofind(1,txid,vout)) != 0 && LP_isavailable(utxo) == 0 ) + { + char str[65]; printf("%s/v%d not available\n",bits256_str(str,txid),vout); + return(utxo); + } + if ( (utxo= _LP_utxo2find(1,txid,vout)) != 0 && LP_isavailable(utxo) == 0 ) + { + char str[65]; printf("%s/v%d not available2\n",bits256_str(str,txid),vout); + return(utxo); + } + return(0); } int32_t LP_address_utxo_ptrs(int32_t iambob,struct LP_address_utxo **utxos,int32_t max,struct LP_address *ap) @@ -145,7 +155,7 @@ int32_t LP_address_utxo_ptrs(int32_t iambob,struct LP_address_utxo **utxos,int32 { if ( up->spendheight <= 0 ) { - if ( LP_unallocated(iambob,up->U.txid,up->U.vout) != 0 ) + if ( LP_unallocated(up->U.txid,up->U.vout) == 0 ) { utxos[n++] = up; if ( n >= max )