Browse Source

Test

etomic
jl777 8 years ago
parent
commit
72a9613a4d
  1. 10
      basilisk/basilisk.c
  2. 4
      iguana/iguana_payments.c

10
basilisk/basilisk.c

@ -48,28 +48,28 @@ cJSON *basilisk_utxosweep(struct supernet_info *myinfo,char *symbol,int64_t *sat
item = jitem(array,i);
if ( (value= SATOSHIDEN*jdouble(item,"amount")) != 0 || (value= SATOSHIDEN*jdouble(item,"value")) != 0 )
{
fprintf(stderr,"%.8f ",dstr(value));
//fprintf(stderr,"%.8f ",dstr(value));
if ( value <= limit )
{
fprintf(stderr,"< ");
//fprintf(stderr,"< ");
if ( utxos == 0 )
utxos = cJSON_CreateArray();
jaddi(utxos,jduplicate(item));
}
else if ( value > biggest )
{
fprintf(stderr,"biggest! ");
//fprintf(stderr,"biggest! ");
if ( biggestitem != 0 )
free_json(biggestitem);
biggestitem = jduplicate(item);
*satoshis = biggest = value;
} else fprintf(stderr,"> ");
} //else fprintf(stderr,"> ");
}
}
free_json(array);
if ( utxos == 0 && biggestitem != 0 )
{
printf("add biggest.(%s)\n",jprint(biggestitem,0));
fprintf(stderr,"add biggest.(%s)\n",jprint(biggestitem,0));
jaddi(utxos,biggestitem);
}
}

4
iguana/iguana_payments.c

@ -554,7 +554,10 @@ char *iguana_calcutxorawtx(struct supernet_info *myinfo,struct iguana_info *coin
for (i=0; i<numoutputs; i++)
satoshis += outputs[i];
if ( (n= cJSON_GetArraySize(utxos)) == 0 )
{
fprintf(stderr,"iguana_calcutxorawtx: no utxos provided?\n");
return(0);
}
for (i=0; i<n; i++)
{
item = jitem(utxos,i);
@ -570,6 +573,7 @@ char *iguana_calcutxorawtx(struct supernet_info *myinfo,struct iguana_info *coin
unspents = realloc(unspents,(1 + max) * sizeof(*unspents));
value = jdouble(item,"value") * SATOSHIDEN;
interests += SATOSHIDEN * jdouble(item,"interest");
printf("(%s) ",jprint(item,0));
iguana_outptset(myinfo,coin,&unspents[max++],jbits256(item,"txid"),jint(item,"vout"),value,spendscriptstr);
avail += value;
}

Loading…
Cancel
Save