|
|
@ -241,75 +241,6 @@ cJSON *iguana_RTinputsjson(struct supernet_info *myinfo,struct iguana_info *coin |
|
|
|
//printf("%s value %.8f -> remains %.8f\n",coinaddr,dstr(value),dstr(remains));
|
|
|
|
if ( remains <= 0 ) |
|
|
|
break; |
|
|
|
/*continue;
|
|
|
|
if ( coin->FULLNODE == 0 && coin->VALIDATENODE == 0 ) |
|
|
|
{ |
|
|
|
if ( (spendlen= basilisk_unspentfind(myinfo,coin,&txid,&vout,spendscript,outpt,outpt.value)) > 0 ) |
|
|
|
{ |
|
|
|
jaddi(vins,iguana_inputjson(txid,vout,spendscript,spendlen)); |
|
|
|
total += outpt.value; |
|
|
|
remains -= outpt.value; |
|
|
|
//printf("%s value %.8f -> remains %.8f\n",coinaddr,dstr(value),dstr(remains));
|
|
|
|
if ( remains <= 0 ) |
|
|
|
break; |
|
|
|
} |
|
|
|
continue; |
|
|
|
} |
|
|
|
if ( (spendlen= _iguana_RTunspentfind(myinfo,coin,&txid,&vout,spendscript,outpt,outpt.value)) > 0 ) |
|
|
|
{ |
|
|
|
jaddi(vins,iguana_inputjson(txid,vout,spendscript,spendlen)); |
|
|
|
total += outpt.value; |
|
|
|
remains -= outpt.value; |
|
|
|
//printf("%s value %.8f -> remains %.8f\n",coinaddr,dstr(value),dstr(remains));
|
|
|
|
if ( remains <= 0 ) |
|
|
|
break; |
|
|
|
continue; |
|
|
|
} |
|
|
|
if ( (bp= coin->bundles[outpt.hdrsi]) == 0 ) |
|
|
|
{ |
|
|
|
printf("no bundle.[%d]\n",outpt.hdrsi); |
|
|
|
free_json(vins); |
|
|
|
return(0); |
|
|
|
} |
|
|
|
ramchain = &bp->ramchain; |
|
|
|
if ( (rdata= ramchain->H.data) == 0 ) |
|
|
|
continue; |
|
|
|
U = RAMCHAIN_PTR(rdata,Uoffset); |
|
|
|
T = RAMCHAIN_PTR(rdata,Toffset); |
|
|
|
if ( outpt.unspentind > 0 && outpt.unspentind < rdata->numunspents ) |
|
|
|
{ |
|
|
|
u = &U[outpt.unspentind]; |
|
|
|
if ( (txidind= u->txidind) > 0 && txidind < rdata->numtxids ) |
|
|
|
{ |
|
|
|
if ( iguana_RTunspentindfind(myinfo,coin,&outpt2,coinaddr,spendscript,&spendlen,&amount,&height,T[txidind].txid,u->vout,coin->bundlescount-1,0) == 0 && spendlen > 0 ) |
|
|
|
{ |
|
|
|
jaddi(vins,iguana_inputjson(T[txidind].txid,u->vout,spendscript,spendlen)); |
|
|
|
total += outpt.value; |
|
|
|
remains -= outpt.value; |
|
|
|
//printf("%s value %.8f -> remains %.8f\n",coinaddr,dstr(value),dstr(remains));
|
|
|
|
if ( remains <= 0 ) |
|
|
|
break; |
|
|
|
} |
|
|
|
else |
|
|
|
{ |
|
|
|
char str[65];printf("couldnt get script for %s.%d\n",bits256_str(str,T[txidind].txid),u->vout); |
|
|
|
free_json(vins); |
|
|
|
return(0); |
|
|
|
} |
|
|
|
} |
|
|
|
else |
|
|
|
{ |
|
|
|
printf("illegal txidind.%d [%d]\n",txidind,outpt.hdrsi); |
|
|
|
free_json(vins); |
|
|
|
return(0); |
|
|
|
} |
|
|
|
} |
|
|
|
else |
|
|
|
{ |
|
|
|
printf("%s illegal unspentind.u%d [%d]\n",coin->symbol,outpt.unspentind,outpt.hdrsi); |
|
|
|
free_json(vins); |
|
|
|
return(0); |
|
|
|
}*/ |
|
|
|
} |
|
|
|
*totalp = total; |
|
|
|
return(vins); |
|
|
|