From 87382417a849ee9e3842c86c7e6c21d3e527f7de Mon Sep 17 00:00:00 2001 From: jl777 Date: Thu, 14 Jul 2016 01:29:02 -0300 Subject: [PATCH] test --- iguana/iguana_unspents.c | 11 ++++++----- 1 file changed, 6 insertions(+), 5 deletions(-) diff --git a/iguana/iguana_unspents.c b/iguana/iguana_unspents.c index 523c5e846..ede04c7cb 100755 --- a/iguana/iguana_unspents.c +++ b/iguana/iguana_unspents.c @@ -557,7 +557,7 @@ int32_t iguana_unspent_check(struct supernet_info *myinfo,struct iguana_info *co int32_t iguana_unspentslists(struct supernet_info *myinfo,struct iguana_info *coin,int64_t *totalp,int64_t *unspents,int32_t max,int64_t required,int32_t minconf,cJSON *addresses,char *remoteaddr) { - int64_t total,sum = 0; uint32_t unspentind; int32_t i,n,j,r,hdrsi,numunspents,numaddrs; uint8_t addrtype,pubkey[65],rmd160[20]; char *coinaddr,str[65]; struct iguana_waddress *waddr; struct iguana_waccount *wacct; struct basilisk_unspent *bu; + int64_t *candidates,total,sum = 0; uint32_t unspentind; int32_t i,n,j,r,hdrsi,numunspents,numaddrs; uint8_t addrtype,pubkey[65],rmd160[20]; char *coinaddr,str[65]; struct iguana_waddress *waddr; struct iguana_waccount *wacct; struct basilisk_unspent *bu; *totalp = 0; if ( (numaddrs= cJSON_GetArraySize(addresses)) == 0 ) { @@ -579,14 +579,15 @@ int32_t iguana_unspentslists(struct supernet_info *myinfo,struct iguana_info *co iguana_pkhasharray(myinfo,coin,0,minconf,coin->longestchain,&total,0,coin->bundlescount,rmd160,coinaddr,pubkey,coin->blocks.hwmchain.height - minconf,unspents,&n,max-1000,remoteaddr); if ( n > 0 ) { + candidates = unspents; for (j=0; j> 32); - unspentind = (int32_t)*unspents; + hdrsi = (int32_t)(candidates[j << 1] >> 32); + unspentind = (int32_t)candidates[j << 1]; if ( iguana_unspent_check(myinfo,coin,hdrsi,unspentind) == 0 ) { - printf("(%d u%d) %.8f not in mempool\n",hdrsi,unspentind,dstr(unspents[1])); - sum += unspents[1]; + printf("(%d u%d) %.8f not in mempool\n",hdrsi,unspentind,dstr(candidates[(j << 1) + 1])); + sum += candidates[(j << 1) + 1]; unspents += 2; numunspents++; }