Browse Source

test

etomic
jl777 8 years ago
parent
commit
ae0c354e74
  1. 12
      iguana/iguana_payments.c
  2. 3
      iguana/main.c
  3. 2
      iguana/tests/deximportaddress

12
iguana/iguana_payments.c

@ -410,7 +410,7 @@ uint64_t iguana_interests(struct supernet_info *myinfo,struct iguana_info *coin,
char *iguana_calcrawtx(struct supernet_info *myinfo,struct iguana_info *coin,cJSON **vinsp,cJSON *txobj,int64_t satoshis,char *changeaddr,int64_t txfee,cJSON *addresses,int32_t minconf,uint8_t *opreturn,int32_t oplen,int64_t burnamount,char *remoteaddr,struct vin_info *V,int32_t maxmode)
{
uint8_t addrtype,rmd160[20],spendscript[IGUANA_MAXSCRIPTSIZE]; char *coinaddr; int32_t allocflag=0,max,i,j,m,n,num,spendlen; char *spendscriptstr,*rawtx=0; bits256 txid; cJSON *vins=0,*array,*item; uint64_t value,avail=0,total,change; struct iguana_outpoint *unspents = 0;
uint8_t addrtype,rmd160[20],spendscript[IGUANA_MAXSCRIPTSIZE]; char *coinaddr; int32_t allocflag=0,max,i,j,m,n,num,spendlen; char *spendscriptstr,*rawtx=0; bits256 txid; cJSON *vins=0,*array,*item; uint64_t value,avail=0,total,change,interest; struct iguana_outpoint *unspents = 0;
*vinsp = 0;
max = 0;//10000;
satoshis += burnamount;
@ -436,6 +436,8 @@ char *iguana_calcrawtx(struct supernet_info *myinfo,struct iguana_info *coin,cJS
}
unspents = realloc(unspents,(1 + max) * sizeof(*unspents));
value = jdouble(item,"amount") * SATOSHIDEN;
if ( jdouble(item,"interest") != 0 )
printf("utxo has interest of %.8f\n",jdouble(item,"interest"));
iguana_outptset(myinfo,coin,&unspents[max++],jbits256(item,"txid"),jint(item,"vout"),value,spendscriptstr);
avail += value;
}
@ -458,7 +460,13 @@ char *iguana_calcrawtx(struct supernet_info *myinfo,struct iguana_info *coin,cJS
if ( (vins= iguana_RTinputsjson(myinfo,coin,&total,satoshis + txfee,unspents,num,maxmode)) != 0 )
{
if ( strcmp(coin->symbol,"KMD") == 0 )
total += iguana_interests(myinfo,coin,vins);
{
if ( (interest= iguana_interests(myinfo,coin,vins)) != 0 )
{
total += interest;
printf("boost total by interest %.8f\n",dstr(interest));
}
}
if ( total < (satoshis + txfee) )
{
free_json(vins);

3
iguana/main.c

@ -1778,3 +1778,6 @@ void iguana_main(void *arg)
iguana_launchdaemons(myinfo);
}
// features
// komodod convert passphrase to privkey
// iguana init nanomsg in own thread

2
iguana/tests/deximportaddress

@ -1,2 +1,2 @@
#!/bin/bash
curl --url "http://127.0.0.1:7778" --data "{\"agent\":\"dex\",\"method\":\"importaddress\",\"address\":\"RHSA9ocZc77tHiFvVQ2h26AJQFsionWAXK\",\"symbol\":\"KMD\"}"
curl --url "http://127.0.0.1:7778" --data "{\"agent\":\"dex\",\"method\":\"importaddress\",\"address\":\"R9pgJYo7ZeTJPQWJYHxgmdM8uXY6Pv7NUe\",\"symbol\":\"KMD\"}"

Loading…
Cancel
Save