|
|
@ -427,17 +427,22 @@ int32_t iguana_unspentslists(struct supernet_info *myinfo,struct iguana_info *co |
|
|
|
int64_t remains,total,sum = 0; int32_t i,n,numunspents,numaddrs; uint8_t addrtype,pubkey[65],rmd160[20]; char *coinaddr; |
|
|
|
*totalp = 0; |
|
|
|
if ( (numaddrs= cJSON_GetArraySize(addresses)) == 0 ) |
|
|
|
{ |
|
|
|
printf("null addresses.(%s)\n",jprint(addresses,0)); |
|
|
|
return(0); |
|
|
|
} |
|
|
|
memset(pubkey,0,sizeof(pubkey)); |
|
|
|
remains = required * 1.1 + coin->txfee; |
|
|
|
for (i=numunspents=0; i<numaddrs; i++) |
|
|
|
{ |
|
|
|
if ( (coinaddr= jstri(addresses,i)) != 0 ) |
|
|
|
{ |
|
|
|
printf("i.%d coinaddr.(%s) minconf.%d longest.%d diff.%d\n",i,coinaddr,minconf,coin->longestchain,coin->blocks.hwmchain.height - minconf); |
|
|
|
total = 0; |
|
|
|
n = 0; |
|
|
|
bitcoin_addr2rmd160(&addrtype,rmd160,coinaddr); |
|
|
|
iguana_pkhasharray(myinfo,coin,0,minconf,coin->longestchain,&total,0,coin->bundlescount,rmd160,coinaddr,pubkey,coin->blocks.hwmchain.height - minconf,unspents,&n,max-1000); |
|
|
|
printf("n.%d max.%d total %.8f\n",n,max,dstr(total)); |
|
|
|
if ( n > 0 ) |
|
|
|
{ |
|
|
|
sum += total; |
|
|
|