|
|
@ -225,6 +225,29 @@ int32_t LP_getheight(struct iguana_info *coin) |
|
|
|
return(height); |
|
|
|
} |
|
|
|
|
|
|
|
uint64_t LP_smartbalance(struct iguana_info *coin) |
|
|
|
{ |
|
|
|
cJSON *array,*item; char buf[512],*retstr; int32_t i,n; uint64_t valuesum,value; |
|
|
|
valuesum = 0; |
|
|
|
sprintf(buf,"[0, 99999999, [\"%s\"]]",coin->smartaddr); |
|
|
|
retstr = bitcoind_passthru(coin->symbol,coin->serverport,coin->userpass,"listunspent","[]"); |
|
|
|
if ( retstr != 0 && retstr[0] != 0 ) |
|
|
|
{ |
|
|
|
array = cJSON_Parse(retstr); |
|
|
|
if ( is_cJSON_Array(array) != 0 && (n= cJSON_GetArraySize(array)) > 0 ) |
|
|
|
{ |
|
|
|
for (i=0; i<n; i++) |
|
|
|
{ |
|
|
|
item = jitem(array,i); |
|
|
|
value = LP_value_extract(item,1); |
|
|
|
valuesum += value; |
|
|
|
} |
|
|
|
} |
|
|
|
free_json(array); |
|
|
|
} |
|
|
|
return(valuesum); |
|
|
|
} |
|
|
|
|
|
|
|
cJSON *LP_getmempool(char *symbol,char *coinaddr) |
|
|
|
{ |
|
|
|
cJSON *array; struct iguana_info *coin; |
|
|
|