Browse Source

test

release/v0.1
jl777 9 years ago
parent
commit
bcae99bc16
  1. 17
      deprecated/obsolete.h
  2. 3
      iguana/iguana777.h
  3. 17
      iguana/iguana_rpc.c
  4. 70
      iguana/iguana_unspents.c
  5. 111
      iguana/iguana_wallet.c
  6. 2
      iguana/ramchain_api.c
  7. 2
      includes/iguana_apideclares.h

17
deprecated/obsolete.h

@ -16228,6 +16228,23 @@ len = 0;
//iguana_realtime_update(coin);
}
}*/
/*int32_t numrmds,minconf=0,maxconf=0,m = 0; uint8_t *rmdarray; cJSON *retjson;
retjson = cJSON_CreateArray();
if ( (minconf= juint(params[0],0)) > 0 )
{
m++;
if ( (maxconf= juint(params[1],0)) > 0 )
m++;
}
if ( minconf == 0 )
minconf = 1;
if ( maxconf == 0 )
maxconf = 9999999;
rmdarray = iguana_rmdarray(coin,&numrmds,array,m);
iguana_unspents(myinfo,coin,retjson,minconf,maxconf,rmdarray,numrmds);
if ( rmdarray != 0 )
free(rmdarray);
return(jprint(retjson,1));*/
#endif
#endif

3
iguana/iguana777.h

@ -832,7 +832,7 @@ void iguana_addinputs(struct iguana_info *coin,struct bitcoin_spend *spend,cJSON
int32_t iguana_pkhasharray(struct iguana_info *coin,cJSON *array,int32_t minconf,int32_t maxconf,int64_t *totalp,struct iguana_pkhash *P,int32_t max,uint8_t rmd160[20],char *coinaddr,uint8_t *pubkey33,int32_t lastheight);
long iguana_spentsfile(struct iguana_info *coin,int32_t n);
uint8_t *iguana_rmdarray(struct iguana_info *coin,int32_t *numrmdsp,cJSON *array,int32_t firsti);
void iguana_unspents(struct supernet_info *myinfo,struct iguana_info *coin,cJSON *array,int32_t minconf,int32_t maxconf,uint8_t *rmdarray,int32_t numrmds);
int64_t iguana_unspents(struct supernet_info *myinfo,struct iguana_info *coin,cJSON *array,int32_t minconf,int32_t maxconf,uint8_t *rmdarray,int32_t numrmds,int32_t lastheight);
uint8_t *iguana_walletrmds(struct supernet_info *myinfo,struct iguana_info *coin,int32_t *numrmdsp);
char *iguana_bundleaddrs(struct iguana_info *coin,int32_t hdrsi);
uint32_t iguana_sparseaddpk(uint8_t *bits,int32_t width,uint32_t tablesize,uint8_t rmd160[20],struct iguana_pkhash *P,uint32_t pkind,struct iguana_ramchain *ramchain);
@ -925,6 +925,7 @@ int32_t iguana_voutscript(struct iguana_info *coin,struct iguana_bundle *bp,uint
cJSON *iguana_unspentjson(struct iguana_info *coin,int32_t hdrsi,uint32_t unspentind,struct iguana_txid *T,struct iguana_unspent *up,uint8_t rmd160[20],char *coinaddr,uint8_t *pubkey33);
int32_t bitcoin_standardspend(uint8_t *script,int32_t n,uint8_t rmd160[20]);
struct iguana_waddress *iguana_waddresssearch(struct iguana_info *coin,struct iguana_waccount **wacctp,char *coinaddr);
int64_t iguana_addressreceived(struct supernet_info *myinfo,struct iguana_info *coin,cJSON *json,char *remoteaddr,cJSON *txids,cJSON *vouts,char *coinaddr,int32_t minconf);
extern int32_t HDRnet,netBLOCKS;

17
iguana/iguana_rpc.c

@ -407,23 +407,6 @@ static char *verifymessage(RPCARGS)
static char *listunspent(RPCARGS)
{
return(sglue3(0,CALLGLUE,"bitcoinrpc","listunspent","minconf",params[0],"maxconf",params[1],"array",params[2]));
/*int32_t numrmds,minconf=0,maxconf=0,m = 0; uint8_t *rmdarray; cJSON *retjson;
retjson = cJSON_CreateArray();
if ( (minconf= juint(params[0],0)) > 0 )
{
m++;
if ( (maxconf= juint(params[1],0)) > 0 )
m++;
}
if ( minconf == 0 )
minconf = 1;
if ( maxconf == 0 )
maxconf = 9999999;
rmdarray = iguana_rmdarray(coin,&numrmds,array,m);
iguana_unspents(myinfo,coin,retjson,minconf,maxconf,rmdarray,numrmds);
if ( rmdarray != 0 )
free(rmdarray);
return(jprint(retjson,1));*/
}
static char *lockunspent(RPCARGS)

70
iguana/iguana_unspents.c

@ -613,9 +613,9 @@ struct iguana_txid *iguana_txidfind(struct iguana_info *coin,int32_t *heightp,st
}
if ( (T= ramchain->cacheT) == 0 )
{
if ( coin->fastfind == 0 )
iguana_alloccacheT(coin,ramchain);
if ( (T= ramchain->cacheT) == 0 )
//if ( coin->fastfind == 0 )
// iguana_alloccacheT(coin,ramchain);
//if ( (T= ramchain->cacheT) == 0 )
T = (void *)(long)((long)ramchain->H.data + ramchain->H.data->Toffset);
}
if ( (txidind= iguana_sparseaddtx(TXbits,ramchain->H.data->txsparsebits,ramchain->H.data->numtxsparse,txid,T,0,ramchain)) > 0 )
@ -1198,7 +1198,7 @@ int32_t iguana_uheight(struct iguana_info *coin,int32_t bundleheight,struct igua
else return(bundleheight);
}
int64_t iguana_pkhashbalance(struct iguana_info *coin,cJSON *array,int64_t *spentp,int32_t *nump,struct iguana_ramchain *ramchain,struct iguana_pkhash *p,uint32_t lastunspentind,uint8_t rmd160[20],char *coinaddr,uint8_t *pubkey33,int32_t hdrsi,int32_t height,int32_t minconf,int32_t maxconf)
int64_t iguana_pkhashbalance(struct iguana_info *coin,cJSON *array,int64_t *spentp,int32_t *nump,struct iguana_ramchain *ramchain,struct iguana_pkhash *p,uint32_t lastunspentind,uint8_t rmd160[20],char *coinaddr,uint8_t *pubkey33,int32_t hdrsi,int32_t lastheight,int32_t minconf,int32_t maxconf)
{
struct iguana_unspent *U; struct iguana_utxo *U2; struct iguana_spend *S; int32_t uheight,spentheight; uint32_t pkind=0,unspentind; int64_t spent = 0,checkval,deposits = 0; struct iguana_txid *T; struct iguana_account *A2; struct iguana_ramchaindata *rdata = 0; int64_t RTspend = 0;
*spentp = *nump = 0;
@ -1216,16 +1216,16 @@ int64_t iguana_pkhashbalance(struct iguana_info *coin,cJSON *array,int64_t *spen
U = (void *)(long)((long)rdata + rdata->Uoffset);
T = (void *)(long)((long)rdata + rdata->Toffset);
RTspend = 0;
if ( height == 0 )
height = IGUANA_MAXHEIGHT;
if ( lastheight == 0 )
lastheight = IGUANA_MAXHEIGHT;
while ( unspentind > 0 )
{
(*nump)++;
uheight = iguana_uheight(coin,ramchain->height,T,rdata->numtxids,&U[unspentind]);
if ( uheight < height )
if ( uheight < lastheight )
{
deposits += U[unspentind].value;
if ( iguana_spentflag(coin,&RTspend,&spentheight,ramchain,hdrsi,unspentind,height,minconf,maxconf,U[unspentind].value) == 0 )
if ( lastheight < 0 || iguana_spentflag(coin,&RTspend,&spentheight,ramchain,hdrsi,unspentind,lastheight,minconf,maxconf,U[unspentind].value) == 0 )
{
if ( array != 0 )
jaddi(array,iguana_unspentjson(coin,hdrsi,unspentind,T,&U[unspentind],rmd160,coinaddr,pubkey33));
@ -1236,7 +1236,7 @@ int64_t iguana_pkhashbalance(struct iguana_info *coin,cJSON *array,int64_t *spen
pkind = p->pkind;
unspentind = U[unspentind].prevunspentind;
}
if ( (A2= ramchain->A2) != 0 && (U2= ramchain->Uextras) != 0 )
if ( lastheight > 0 && (A2= ramchain->A2) != 0 && (U2= ramchain->Uextras) != 0 )
{
S = (void *)(long)((long)rdata + rdata->Soffset);
unspentind = A2[pkind].lastunspentind;
@ -1244,7 +1244,7 @@ int64_t iguana_pkhashbalance(struct iguana_info *coin,cJSON *array,int64_t *spen
while ( unspentind > 0 )
{
uheight = iguana_uheight(coin,ramchain->height,T,rdata->numtxids,&U[unspentind]);
if ( uheight < height )
if ( uheight < lastheight )
{
checkval += U[unspentind].value;
//printf("u%u %.8f spentflag.%d prev.%u fromheight.%d\n",unspentind,dstr(U[unspentind].value),U2[unspentind].spentflag,U2[unspentind].prevunspentind,U2[unspentind].fromheight);
@ -1252,7 +1252,7 @@ int64_t iguana_pkhashbalance(struct iguana_info *coin,cJSON *array,int64_t *spen
unspentind = U2[unspentind].prevunspentind;
}
if ( fabs(spent - checkval - RTspend) > SMALLVAL )
printf("spend %s: [%d] deposits %.8f spent %.8f check %.8f (%.8f) vs A2[%u] %.8f\n",height==0?"checkerr":"",hdrsi,dstr(deposits),dstr(spent),dstr(checkval)+dstr(RTspend),dstr(*spentp),pkind,dstr(A2[pkind].total));
printf("spend %s: [%d] deposits %.8f spent %.8f check %.8f (%.8f) vs A2[%u] %.8f\n",lastheight==IGUANA_MAXHEIGHT?"checkerr":"",hdrsi,dstr(deposits),dstr(spent),dstr(checkval)+dstr(RTspend),dstr(*spentp),pkind,dstr(A2[pkind].total));
}
(*spentp) = spent;
//printf("spent %.8f, RTspent %.8f deposits %.8f\n",dstr(spent),dstr(RTspend),dstr(deposits));
@ -1299,13 +1299,13 @@ int32_t iguana_pkhasharray(struct iguana_info *coin,cJSON *array,int32_t minconf
return(n);
}
void iguana_unspents(struct supernet_info *myinfo,struct iguana_info *coin,cJSON *array,int32_t minconf,int32_t maxconf,uint8_t *rmdarray,int32_t numrmds)
int64_t iguana_unspents(struct supernet_info *myinfo,struct iguana_info *coin,cJSON *array,int32_t minconf,int32_t maxconf,uint8_t *rmdarray,int32_t numrmds,int32_t lastheight)
{
int64_t total,sum=0; struct iguana_pkhash *P; uint8_t *addrtypes,*pubkeys; int32_t i,flag = 0; char coinaddr[64];
if ( 0 && coin->RTramchain_busy != 0 )
{
printf("iguana_pkhasharray: unexpected access when RTramchain_busy\n");
return;
return(sum);
}
if ( rmdarray == 0 )
rmdarray = iguana_walletrmds(myinfo,coin,&numrmds), flag++;
@ -1316,7 +1316,7 @@ void iguana_unspents(struct supernet_info *myinfo,struct iguana_info *coin,cJSON
for (i=0; i<numrmds; i++)
{
bitcoin_address(coinaddr,addrtypes[i],&rmdarray[i * 20],20);
iguana_pkhasharray(coin,array,minconf,maxconf,&total,P,coin->bundlescount,&rmdarray[i * 20],coinaddr,&pubkeys[33*i],0);
iguana_pkhasharray(coin,array,minconf,maxconf,&total,P,coin->bundlescount,&rmdarray[i * 20],coinaddr,&pubkeys[33*i],lastheight);
printf("i.%d of %d: %s %.8f\n",i,numrmds,coinaddr,dstr(total));
sum += total;
}
@ -1325,6 +1325,7 @@ void iguana_unspents(struct supernet_info *myinfo,struct iguana_info *coin,cJSON
}
if ( flag != 0 && rmdarray != 0 )
free(rmdarray);
return(sum);
}
static inline int32_t _iguana_spendvectorconv(struct iguana_spendvector *ptr,struct iguana_unspent *u,int32_t numpkinds,int32_t hdrsi,uint32_t unspentind)
@ -2625,7 +2626,7 @@ STRING_ARG(iguana,initfastfind,activecoin)
} else return(clonestr("{\"error\":\"no coin to initialize\"}"));
}
TWOSTRINGS_AND_INT(iguana,balance,activecoin,address,height)
TWOSTRINGS_AND_INT(iguana,balance,activecoin,address,lastheight)
{
int32_t minconf=1,maxconf=SATOSHIDEN; int64_t total; uint8_t rmd160[20],pubkey33[33],addrtype;
struct iguana_pkhash *P; cJSON *array,*retjson = cJSON_CreateObject();
@ -2647,16 +2648,43 @@ TWOSTRINGS_AND_INT(iguana,balance,activecoin,address,height)
memset(pubkey33,0,sizeof(pubkey33));
P = calloc(coin->bundlescount,sizeof(*P));
array = cJSON_CreateArray();
printf("Start %s balance.(%s) height.%d\n",coin->symbol,address,height);
if ( height == 0 )
height = IGUANA_MAXHEIGHT;
iguana_pkhasharray(coin,array,minconf,maxconf,&total,P,coin->bundlescount,rmd160,address,pubkey33,height);
printf("Start %s balance.(%s) height.%d\n",coin->symbol,address,lastheight);
if ( lastheight == 0 )
lastheight = IGUANA_MAXHEIGHT;
iguana_pkhasharray(coin,array,minconf,maxconf,&total,P,coin->bundlescount,rmd160,address,pubkey33,lastheight);
free(P);
jadd(retjson,"unspents",array);
jaddnum(retjson,"balance",dstr(total));
if ( height != 0 )
jaddnum(retjson,"height",height);
if ( lastheight > 0 )
jaddnum(retjson,"lastheight",lastheight);
}
return(jprint(retjson,1));
}
int64_t iguana_addressreceived(struct supernet_info *myinfo,struct iguana_info *coin,cJSON *json,char *remoteaddr,cJSON *txids,cJSON *vouts,char *coinaddr,int32_t minconf)
{
int64_t balance = 0; cJSON *unspentsjson,*balancejson,*item; int32_t i,n; char *balancestr;
if ( (balancestr= iguana_balance(IGUANA_CALLARGS,coin->symbol,coinaddr,-1)) != 0 )
{
if ( (balancejson= cJSON_Parse(balancestr)) != 0 )
{
balance = jdouble(balancejson,"balance") * SATOSHIDEN;
if ( (txids != 0 || vouts != 0) && (unspentsjson= jarray(&n,balancejson,"unspents")) != 0 )
{
for (i=0; i<n; i++)
{
item = jitem(balancejson,i);
if ( txids != 0 )
jaddibits256(txids,jbits256(item,"txid"));
if ( vouts != 0 )
jaddinum(vouts,jint(item,"vout"));
}
}
free_json(balancejson);
}
free(balancestr);
}
return(balance);
}
#include "../includes/iguana_apiundefs.h"

111
iguana/iguana_wallet.c

@ -139,7 +139,7 @@ uint8_t *iguana_walletrmds(struct supernet_info *myinfo,struct iguana_info *coin
return(rmdarray);
}
char *getaddressesbyaccount(struct supernet_info *myinfo,struct iguana_info *coin,char *account)
cJSON *getaddressesbyaccount(struct supernet_info *myinfo,struct iguana_info *coin,char *account)
{
struct iguana_waccount *subset; struct iguana_waddress *waddr,*tmp; cJSON *retjson,*array;
retjson = cJSON_CreateObject();
@ -151,8 +151,7 @@ char *getaddressesbyaccount(struct supernet_info *myinfo,struct iguana_info *coi
jaddistr(array,waddr->coinaddr);
}
} else jaddstr(retjson,"result","cant find account");
jadd(retjson,"addresses",array);
return(jprint(retjson,1));
return(array);
}
struct iguana_waddress *iguana_waccountadd(struct iguana_info *coin,struct iguana_waccount **wacctp,char *walletaccount,char *coinaddr)
@ -760,53 +759,100 @@ STRING_ARG(bitcoinrpc,importwallet,filename)
}
// multiple address
THREE_INTS(bitcoinrpc,getbalance,confirmations,includeempty,watchonly)
STRING_AND_THREEINTS(bitcoinrpc,getbalance,account,minconf,includeempty,lastheight)
{
cJSON *retjson;
int64_t balance; int32_t numrmds=0; uint8_t *rmdarray=0; cJSON *retjson;
if ( remoteaddr != 0 )
return(clonestr("{\"error\":\"no remote\"}"));
if ( minconf == 0 )
minconf = 1;
if ( strcmp(account,"*") != 0 )
rmdarray = iguana_rmdarray(coin,&numrmds,getaddressesbyaccount(myinfo,coin,account),0);
balance = iguana_unspents(myinfo,coin,0,minconf,(1 << 30),rmdarray,numrmds,lastheight);
if ( rmdarray != 0 )
free(rmdarray);
retjson = cJSON_CreateObject();
jaddnum(retjson,"result",dstr(balance));
return(jprint(retjson,1));
}
STRING_ARG(bitcoinrpc,getaddressesbyaccount,account)
{
cJSON *retjson; struct iguana_waccount *wacct;
cJSON *retjson;
if ( remoteaddr != 0 )
return(clonestr("{\"error\":\"no remote\"}"));
if ( (wacct= iguana_waccountfind(coin,account)) != 0 )
{
}
retjson = cJSON_CreateObject();
jadd(retjson,"result",getaddressesbyaccount(myinfo,coin,account));
return(jprint(retjson,1));
}
STRING_AND_INT(bitcoinrpc,getreceivedbyaccount,account,includeempty)
int64_t iguana_waccountbalance(struct supernet_info *myinfo,struct iguana_info *coin,struct iguana_waccount *wacct,int32_t minconf,int32_t lastheight)
{
cJSON *retjson;
int64_t balance; int32_t numrmds=0; uint8_t *rmdarray=0;
if ( minconf == 0 )
minconf = 1;
rmdarray = iguana_rmdarray(coin,&numrmds,getaddressesbyaccount(myinfo,coin,wacct->account),0);
balance = iguana_unspents(myinfo,coin,0,minconf,(1 << 30),rmdarray,numrmds,lastheight);
if ( rmdarray != 0 )
free(rmdarray);
return(balance);
}
STRING_AND_INT(bitcoinrpc,getreceivedbyaccount,account,minconf)
{
cJSON *retjson; struct iguana_waccount *wacct; int64_t balance;
if ( remoteaddr != 0 )
return(clonestr("{\"error\":\"no remote\"}"));
retjson = cJSON_CreateObject();
if ( (wacct= iguana_waccountfind(coin,account)) != 0 )
{
balance = iguana_waccountbalance(myinfo,coin,wacct,minconf,0);
jaddnum(retjson,"result",dstr(balance));
}
return(jprint(retjson,1));
}
THREE_INTS(bitcoinrpc,listreceivedbyaccount,confirmations,includeempty,watchonly)
THREE_INTS(bitcoinrpc,listreceivedbyaccount,minconf,includeempty,watchonly)
{
cJSON *retjson;
cJSON *retjson,*item,*array; struct iguana_waccount *wacct,*tmp; int64_t balance;
if ( remoteaddr != 0 )
return(clonestr("{\"error\":\"no remote\"}"));
array = cJSON_CreateArray();
HASH_ITER(hh,coin->wallet,wacct,tmp)
{
balance = iguana_waccountbalance(myinfo,coin,wacct,minconf,0);
item = cJSON_CreateObject();
jaddstr(item,"account",wacct->account);
jaddnum(item,"amount",dstr(balance));
jaddnum(item,"confirmations",minconf);
jaddi(array,item);
}
retjson = cJSON_CreateObject();
jadd(retjson,"result",array);
return(jprint(retjson,1));
}
THREE_INTS(bitcoinrpc,listreceivedbyaddress,minconf,includeempty,flag)
{
cJSON *retjson;
cJSON *retjson,*item,*array,*txids,*vouts; struct iguana_waccount *wacct,*tmp; struct iguana_waddress *waddr,*tmp2;
if ( remoteaddr != 0 )
return(clonestr("{\"error\":\"no remote\"}"));
array = cJSON_CreateArray();
HASH_ITER(hh,coin->wallet,wacct,tmp)
{
HASH_ITER(hh,wacct->waddr,waddr,tmp2)
{
item = cJSON_CreateObject();
jaddstr(item,"address",waddr->coinaddr);
txids = cJSON_CreateArray();
vouts = cJSON_CreateArray();
jaddnum(item,"amount",dstr(iguana_addressreceived(myinfo,coin,json,remoteaddr,txids,vouts,waddr->coinaddr,minconf)));
jaddi(array,item);
}
}
retjson = cJSON_CreateObject();
return(jsuccess());
jadd(retjson,"result",array);
return(jprint(retjson,1));
}
STRING_AND_THREEINTS(bitcoinrpc,listtransactions,account,count,skip,includewatchonly)
@ -818,43 +864,50 @@ STRING_AND_THREEINTS(bitcoinrpc,listtransactions,account,count,skip,includewatch
return(jsuccess());
}
S_D_SS(bitcoinrpc,sendtoaddress,address,amount,comment,comment2)
TWO_INTS(bitcoinrpc,listaccounts,minconf,includewatchonly)
{
cJSON *retjson;
cJSON *retjson,*array; int64_t balance; struct iguana_waccount *wacct,*tmp;
if ( remoteaddr != 0 )
return(clonestr("{\"error\":\"no remote\"}"));
array = cJSON_CreateObject();
HASH_ITER(hh,coin->wallet,wacct,tmp)
{
balance = iguana_waccountbalance(myinfo,coin,wacct,minconf,0);
jaddnum(array,wacct->account,dstr(balance));
}
retjson = cJSON_CreateObject();
return(jsuccess());
jadd(retjson,"result",array);
return(jprint(retjson,1));
}
SS_D_I_SS(bitcoinrpc,sendfrom,fromaccount,toaddress,amount,minconf,comment,comment2)
ZERO_ARGS(bitcoinrpc,listaddressgroupings)
{
cJSON *retjson;
if ( remoteaddr != 0 )
return(clonestr("{\"error\":\"no remote\"}"));
retjson = cJSON_CreateObject();
return(jsuccess());
return(jprint(retjson,1));
}
DOUBLE_ARG(bitcoinrpc,settxfee,amount)
S_D_SS(bitcoinrpc,sendtoaddress,address,amount,comment,comment2)
{
cJSON *retjson;
if ( remoteaddr != 0 )
return(clonestr("{\"error\":\"no remote\"}"));
retjson = cJSON_CreateObject();
return(jprint(retjson,1));
return(jsuccess());
}
SS_D_I_S(bitcoinrpc,move,fromaccount,toaccount,amount,minconf,comment)
SS_D_I_SS(bitcoinrpc,sendfrom,fromaccount,toaddress,amount,minconf,comment,comment2)
{
cJSON *retjson;
if ( remoteaddr != 0 )
return(clonestr("{\"error\":\"no remote\"}"));
retjson = cJSON_CreateObject();
return(jprint(retjson,1));
return(jsuccess());
}
S_A_I_S(bitcoinrpc,sendmany,fromaccount,array,minconf,comment)
DOUBLE_ARG(bitcoinrpc,settxfee,amount)
{
cJSON *retjson;
if ( remoteaddr != 0 )
@ -863,8 +916,7 @@ S_A_I_S(bitcoinrpc,sendmany,fromaccount,array,minconf,comment)
return(jprint(retjson,1));
}
// entire wallet funcs
TWO_INTS(bitcoinrpc,listaccounts,minconf,includewatchonly)
SS_D_I_S(bitcoinrpc,move,fromaccount,toaccount,amount,minconf,comment)
{
cJSON *retjson;
if ( remoteaddr != 0 )
@ -873,7 +925,7 @@ TWO_INTS(bitcoinrpc,listaccounts,minconf,includewatchonly)
return(jprint(retjson,1));
}
ZERO_ARGS(bitcoinrpc,listaddressgroupings)
S_A_I_S(bitcoinrpc,sendmany,fromaccount,array,minconf,comment)
{
cJSON *retjson;
if ( remoteaddr != 0 )
@ -882,5 +934,6 @@ ZERO_ARGS(bitcoinrpc,listaddressgroupings)
return(jprint(retjson,1));
}
#include "../includes/iguana_apiundefs.h"

2
iguana/ramchain_api.c

@ -578,7 +578,7 @@ TWOINTS_AND_ARRAY(bitcoinrpc,listunspent,minconf,maxconf,array)
if ( maxconf == 0 )
maxconf = 9999999;
rmdarray = iguana_rmdarray(coin,&numrmds,array,0);
iguana_unspents(myinfo,coin,retjson,minconf,maxconf,rmdarray,numrmds);
iguana_unspents(myinfo,coin,retjson,minconf,maxconf,rmdarray,numrmds,0);
if ( rmdarray != 0 )
free(rmdarray);
return(jprint(retjson,1));

2
includes/iguana_apideclares.h

@ -59,7 +59,7 @@ TWO_INTS(bitcoinrpc,listaccounts,minconf,includewatchonly);
ZERO_ARGS(bitcoinrpc,listaddressgroupings);
STRING_AND_INT(bitcoinrpc,getreceivedbyaddress,address,minconf);
STRING_AND_INT(bitcoinrpc,getreceivedbyaccount,account,includeempty);
THREE_INTS(bitcoinrpc,getbalance,confirmations,includeempty,watchonly);
STRING_AND_THREEINTS(bitcoinrpc,getbalance,account,confirmations,includeempty,lastheight);
STRING_ARG(bitcoinrpc,getaddressesbyaccount,account);
STRING_ARG(bitcoinrpc,getaccount,address);
STRING_ARG(bitcoinrpc,getaccountaddress,account);

Loading…
Cancel
Save