Browse Source

test

release/v0.1
jl777 9 years ago
parent
commit
6f7d0dc03c
  1. 3
      iguana/iguana_payments.c
  2. 5
      iguana/iguana_unspents.c

3
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);

5
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; 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;

Loading…
Cancel
Save