Browse Source

test

release/v0.1
jl777 9 years ago
parent
commit
278abd6cf2
  1. 2
      iguana/iguana777.c
  2. 75
      iguana/iguana_wallet.c
  3. 8
      iguana/ramchain_api.c

2
iguana/iguana777.c

@ -416,7 +416,7 @@ int32_t iguana_utxogen(struct iguana_info *coin,int32_t helperid,int32_t convert
printf("skip utxogen as spendvectorsaved.%u\n",coin->spendvectorsaved);
return(0);
}
incr = IGUANA_NUMHELPERS;
incr = 1;//IGUANA_NUMHELPERS;
//if ( 1 || coin->PREFETCHLAG > 0 ) // data issues on slow systems
// incr = 1;
max = coin->bundlescount;

75
iguana/iguana_wallet.c

@ -812,6 +812,66 @@ STRING_AND_INT(bitcoinrpc,getreceivedbyaccount,account,minconf)
return(jprint(retjson,1));
}
STRING_AND_THREEINTS(bitcoinrpc,listtransactions,account,count,skip,includewatchonly)
{
cJSON *retjson,*retarray,*txids,*item,*array; int32_t i,j,total,m,n = 0; struct iguana_waccount *wacct; char *coinaddr;
if ( remoteaddr != 0 )
return(clonestr("{\"error\":\"no remote\"}"));
retjson = cJSON_CreateObject();
retarray = cJSON_CreateArray();
if ( (wacct= iguana_waccountfind(coin,account)) != 0 )
{
if ( (array= getaddressesbyaccount(myinfo,coin,account)) != 0 )
{
if ( (n= cJSON_GetArraySize(array)) > 0 )
{
total = 0;
for (i=0; i<n; i++)
{
if ( (coinaddr= jstr(jitem(array,i),0)) != 0 )
{
txids = cJSON_CreateArray();
iguana_addressreceived(myinfo,coin,json,remoteaddr,txids,0,coinaddr,1);
if ( (m= cJSON_GetArraySize(txids)) > 0 )
{
for (j=0; j<m; j++,total++)
{
if ( skip < -count )
break;
else
{
skip--;
if ( skip <= 0 )
{
/*{
"category": "receive",
"amount": 0.50000000,
"label": "",
"vout": 1,
"confirmations": 24466,
"blockhash": "00000000000000000517ce625737579f91162c46ad9eaccad0f52ca13715b156",
"blockindex": 78,
"blocktime": 1448045745,
"txid": "a40ab455941314a154e2606ff34d52a1001c7059d2c364bb16d6a8edef0abf09",
}*/
item = cJSON_CreateObject();
jaddstr(item,"account",wacct->account);
jaddstr(item,"address",coinaddr);
jaddi(retarray,item);
}
}
}
}
free_json(txids);
}
}
}
}
}
jadd(retjson,"result",retarray);
return(jprint(retjson,1));
}
THREE_INTS(bitcoinrpc,listreceivedbyaccount,minconf,includeempty,watchonly)
{
cJSON *retjson,*item,*array; struct iguana_waccount *wacct,*tmp; int64_t balance;
@ -847,6 +907,8 @@ THREE_INTS(bitcoinrpc,listreceivedbyaddress,minconf,includeempty,flag)
txids = cJSON_CreateArray();
vouts = cJSON_CreateArray();
jaddnum(item,"amount",dstr(iguana_addressreceived(myinfo,coin,json,remoteaddr,txids,vouts,waddr->coinaddr,minconf)));
jadd(item,"txids",txids);
jadd(item,"vouts",vouts);
jaddi(array,item);
}
}
@ -855,15 +917,6 @@ THREE_INTS(bitcoinrpc,listreceivedbyaddress,minconf,includeempty,flag)
return(jprint(retjson,1));
}
STRING_AND_THREEINTS(bitcoinrpc,listtransactions,account,count,skip,includewatchonly)
{
cJSON *retjson;
if ( remoteaddr != 0 )
return(clonestr("{\"error\":\"no remote\"}"));
retjson = cJSON_CreateObject();
return(jsuccess());
}
TWO_INTS(bitcoinrpc,listaccounts,minconf,includewatchonly)
{
cJSON *retjson,*array; int64_t balance; struct iguana_waccount *wacct,*tmp;
@ -882,11 +935,9 @@ TWO_INTS(bitcoinrpc,listaccounts,minconf,includewatchonly)
ZERO_ARGS(bitcoinrpc,listaddressgroupings)
{
cJSON *retjson;
if ( remoteaddr != 0 )
return(clonestr("{\"error\":\"no remote\"}"));
retjson = cJSON_CreateObject();
return(jprint(retjson,1));
return(clonestr("{\"result\":\"success\"}"));
}
S_D_SS(bitcoinrpc,sendtoaddress,address,amount,comment,comment2)

8
iguana/ramchain_api.c

@ -597,14 +597,6 @@ ZERO_ARGS(bitcoinrpc,getrawchangeaddress)
return(jprint(retjson,1));
}
HASH_AND_STRING(bitcoinrpc,verifytx,txid,txbytes)
{
cJSON *retjson;
retjson = bitcoin_txtest(coin,txbytes,txid);
//printf("verifytx.(%s) %p\n",jprint(retjson,0),retjson);
return(jprint(retjson,1));
}
STRING_AND_INT(iguana,bundleaddresses,activecoin,height)
{
struct iguana_info *ptr;

Loading…
Cancel
Save