From 6f7d0dc03c4aa671ce29a566790ccdbb5289ca3c Mon Sep 17 00:00:00 2001 From: jl777 Date: Mon, 4 Jul 2016 10:03:41 -0300 Subject: [PATCH] test --- iguana/iguana_payments.c | 3 +++ iguana/iguana_unspents.c | 5 +++++ 2 files changed, 8 insertions(+) diff --git a/iguana/iguana_payments.c b/iguana/iguana_payments.c index f20b62927..a5104f9e7 100755 --- a/iguana/iguana_payments.c +++ b/iguana/iguana_payments.c @@ -335,6 +335,9 @@ char *iguana_calcrawtx(struct supernet_info *myinfo,struct iguana_info *coin,cJS max = 10000; satoshis += burnamount; unspents = calloc(max,sizeof(*unspents)); + + //iguana_unspents(myinfo,coin,retjson,minconf,maxconf,rmdarray,numrmds,(1 << 30),0,&numunspents); + if ( (num= iguana_unspentslists(myinfo,coin,&avail,unspents,max,satoshis,minconf,addresses)) <= 0 ) { free(unspents); diff --git a/iguana/iguana_unspents.c b/iguana/iguana_unspents.c index 7bf34f394..99799a447 100755 --- a/iguana/iguana_unspents.c +++ b/iguana/iguana_unspents.c @@ -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; ilongestchain,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;