Browse Source

Merge pull request #8 from jl777/dev

dev update
pass-iguana-arg
ca333 7 years ago
committed by GitHub
parent
commit
50c0c47f2c
No known key found for this signature in database GPG Key ID: 4AEE18F83AFDEB23
  1. 50
      iguana/dpow/dpow_network.c
  2. 129
      iguana/exchanges/LP_mmjson.c
  3. 2
      iguana/exchanges/coins.json
  4. 71
      iguana/iguana_notary.c
  5. 26
      iguana/main.c

50
iguana/dpow/dpow_network.c

@ -21,56 +21,6 @@ struct signed_nnpacket
uint8_t packet[];
} PACKED;
/*
NN_CONNECT to (tcp://167.114.118.5:7775)
NN_CONNECT to (tcp://10.0.0.4:7775)
NN_CONNECT to (tcp://85.143.211.6:7775)
NN_CONNECT to (tcp://158.69.25.7:7775)
NN_CONNECT to (tcp://123.249.79.12:7775)
NN_CONNECT to (tcp://141.105.66.18:7775)
NN_CONNECT to (tcp://198.27.75.27:7775)
NN_CONNECT to (tcp://198.204.226.34:7775)
NN_CONNECT to (tcp://144.76.94.38:7775)
NN_CONNECT to (tcp://142.54.174.42:7775)
NN_CONNECT to (tcp://88.198.70.43:7775)
NN_CONNECT to (tcp://182.162.169.44:7775)
NN_CONNECT to (tcp://104.168.128.50:7775)
NN_CONNECT to (tcp://167.114.64.64:7775)
NN_CONNECT to (tcp://185.169.229.64:7775)
NN_CONNECT to (tcp://46.4.68.72:7775)
NN_CONNECT to (tcp://173.208.203.74:7775)
NN_CONNECT to (tcp://192.99.232.81:7775)
NN_CONNECT to (tcp://149.56.28.84:7775)
NN_CONNECT to (tcp://148.251.190.89:7775)
NN_CONNECT to (tcp://149.56.240.91:7775)
NN_CONNECT to (tcp://88.99.56.99:7775)
NN_CONNECT to (tcp://217.106.238.109:7775)
NN_CONNECT to (tcp://142.54.164.114:7775)
NN_CONNECT to (tcp://163.172.101.118:7775)
NN_CONNECT to (tcp://189.1.174.119:7775)
NN_CONNECT to (tcp://1.234.19.123:7775)
NN_CONNECT to (tcp://221.121.144.138:7775)
NN_CONNECT to (tcp://46.166.168.138:7775)
NN_CONNECT to (tcp://221.121.144.140:7775)
NN_CONNECT to (tcp://163.172.100.144:7775)
NN_CONNECT to (tcp://185.106.122.147:7775)
NN_CONNECT to (tcp://103.18.58.150:7775)
NN_CONNECT to (tcp://23.88.234.153:7775)
NN_CONNECT to (tcp://164.132.202.176:7775)
NN_CONNECT to (tcp://178.63.85.196:7775)
NN_CONNECT to (tcp://69.12.77.197:7775)
NN_CONNECT to (tcp://192.157.238.198:7775)
NN_CONNECT to (tcp://209.58.183.199:7775)
NN_CONNECT to (tcp://149.202.65.200:7775)
NN_CONNECT to (tcp://173.208.184.202:7775)
NN_CONNECT to (tcp://94.102.63.208:7775)
NN_CONNECT to (tcp://5.9.109.208:7775)
NN_CONNECT to (tcp://94.102.63.209:7775)
NN_CONNECT to (tcp://197.189.248.210:7775)
NN_CONNECT to (tcp://149.56.19.212:7775)
NN_CONNECT to (tcp://46.165.243.214:7775)
NN_CONNECT to (tcp://45.64.168.216:7775)
*/
void dex_init(struct supernet_info *myinfo)
{

129
iguana/exchanges/LP_mmjson.c

@ -16,7 +16,6 @@
// LP_mmjson.c
// marketmaker
//
#define MMJSON_IPADDR 255
#define MMJSON_BITS256 254
#define MMJSON_SECP33 253
@ -122,7 +121,7 @@ int32_t MMJSON_rwnum(int32_t rwflag,uint8_t *buf,uint64_t *longp,int32_t n)
return(n);
}
int32_t MMJSON_decodeitem(cJSON *lineobj,uint8_t *linebuf,int32_t i,int32_t len,int32_t ind,uint32_t *timestampp)
int32_t MMJSON_decodeitem(cJSON *lineobj,uint8_t *linebuf,int32_t i,int32_t len,char *fieldstr,uint32_t *timestampp)
{
int32_t c,valind,j; char tmpstr[64],ipaddr[64],hexstr[256],arbstr[8192]; uint64_t l;
switch ( (valind= linebuf[i++]) )
@ -130,98 +129,98 @@ int32_t MMJSON_decodeitem(cJSON *lineobj,uint8_t *linebuf,int32_t i,int32_t len,
case MMJSON_IPADDR:
i += MMJSON_rwnum(0,&linebuf[i],&l,4);
expand_ipbits(ipaddr,(uint32_t)l);
jaddstr(lineobj,MM_fields[ind],ipaddr);
jaddstr(lineobj,fieldstr,ipaddr);
break;
case MMJSON_BITS256:
init_hexbytes_noT(hexstr,&linebuf[i],32);
i += 32;
jaddstr(lineobj,MM_fields[ind],hexstr);
jaddstr(lineobj,fieldstr,hexstr);
break;
case MMJSON_SECP33:
init_hexbytes_noT(hexstr,&linebuf[i],33);
i += 33;
jaddstr(lineobj,MM_fields[ind],hexstr);
jaddstr(lineobj,fieldstr,hexstr);
break;
case MMJSON_SIG:
init_hexbytes_noT(hexstr,&linebuf[i],65);
i += 65;
jaddstr(lineobj,MM_fields[ind],hexstr);
jaddstr(lineobj,fieldstr,hexstr);
break;
case MMJSON_RMD160:
init_hexbytes_noT(hexstr,&linebuf[i],20);
i += 20;
jaddstr(lineobj,MM_fields[ind],hexstr);
jaddstr(lineobj,fieldstr,hexstr);
break;
case MMJSON_DECIMAL8:
l = linebuf[i++];
jaddnum(lineobj,MM_fields[ind],l);
jaddnum(lineobj,fieldstr,l);
break;
case MMJSON_DECIMAL8STR:
l = linebuf[i++];
jadd64bits(lineobj,MM_fields[ind],l);
jadd64bits(lineobj,fieldstr,l);
break;
case MMJSON_DECIMAL16:
i += MMJSON_rwnum(0,&linebuf[i],&l,2);
jaddnum(lineobj,MM_fields[ind],l);
jaddnum(lineobj,fieldstr,l);
break;
case MMJSON_DECIMAL16STR:
i += MMJSON_rwnum(0,&linebuf[i],&l,2);
jadd64bits(lineobj,MM_fields[ind],l);
jadd64bits(lineobj,fieldstr,l);
break;
case MMJSON_DECIMAL24:
i += MMJSON_rwnum(0,&linebuf[i],&l,3);
jaddnum(lineobj,MM_fields[ind],l);
jaddnum(lineobj,fieldstr,l);
break;
case MMJSON_DECIMAL24STR:
i += MMJSON_rwnum(0,&linebuf[i],&l,3);
sprintf(tmpstr,"%llu",(long long)l);
jaddstr(lineobj,MM_fields[ind],tmpstr);
jaddstr(lineobj,fieldstr,tmpstr);
break;
case MMJSON_DECIMAL32:
i += MMJSON_rwnum(0,&linebuf[i],&l,4);
//printf("decimal32.%u %08x\n",(uint32_t)l,(uint32_t)l);
jaddnum(lineobj,MM_fields[ind],l);
jaddnum(lineobj,fieldstr,l);
break;
case MMJSON_DECIMAL32STR:
i += MMJSON_rwnum(0,&linebuf[i],&l,4);
//printf("decimal32.%u %08x\n",(uint32_t)l,(uint32_t)l);
jadd64bits(lineobj,MM_fields[ind],l);
jadd64bits(lineobj,fieldstr,l);
break;
case MMJSON_DECIMAL40:
i += MMJSON_rwnum(0,&linebuf[i],&l,5);
jaddnum(lineobj,MM_fields[ind],l);
jaddnum(lineobj,fieldstr,l);
break;
case MMJSON_DECIMAL40STR:
i += MMJSON_rwnum(0,&linebuf[i],&l,5);
jadd64bits(lineobj,MM_fields[ind],l);
jadd64bits(lineobj,fieldstr,l);
break;
case MMJSON_DECIMAL48:
i += MMJSON_rwnum(0,&linebuf[i],&l,6);
jaddnum(lineobj,MM_fields[ind],l);
jaddnum(lineobj,fieldstr,l);
break;
case MMJSON_DECIMAL48STR:
i += MMJSON_rwnum(0,&linebuf[i],&l,6);
jadd64bits(lineobj,MM_fields[ind],l);
jadd64bits(lineobj,fieldstr,l);
break;
case MMJSON_DOUBLE:
i += MMJSON_rwnum(0,&linebuf[i],&l,8);
//printf("double %llu -> %.8f\n",(long long)l,dstr(l));
jaddnum(lineobj,MM_fields[ind],dstr(l));
jaddnum(lineobj,fieldstr,dstr(l));
break;
case MMJSON_DECIMAL64:
i += MMJSON_rwnum(0,&linebuf[i],&l,8);
jadd64bits(lineobj,MM_fields[ind],l);
jadd64bits(lineobj,fieldstr,l);
break;
case MMJSON_DECIMAL64STR:
i += MMJSON_rwnum(0,&linebuf[i],&l,8);
jadd64bits(lineobj,MM_fields[ind],l);
jadd64bits(lineobj,fieldstr,l);
break;
case MMJSON_TIMESTAMP:
if ( *timestampp == 0 )
{
i += MMJSON_rwnum(0,&linebuf[i],&l,4);
*timestampp = (uint32_t)l;
jaddnum(lineobj,MM_fields[ind],l);
jaddnum(lineobj,fieldstr,l);
}
else
{
@ -231,21 +230,21 @@ int32_t MMJSON_decodeitem(cJSON *lineobj,uint8_t *linebuf,int32_t i,int32_t len,
}
break;
case MMJSON_TIMEDIFF8:
jaddnum(lineobj,MM_fields[ind],*timestampp + linebuf[i++]);
jaddnum(lineobj,fieldstr,*timestampp + linebuf[i++]);
break;
case MMJSON_TIMEDIFF16:
i += MMJSON_rwnum(0,&linebuf[i],&l,2);
jaddnum(lineobj,MM_fields[ind],*timestampp + l);
jaddnum(lineobj,fieldstr,*timestampp + l);
break;
case MMJSON_ZERO:
jaddnum(lineobj,MM_fields[ind],0);
jaddnum(lineobj,fieldstr,0);
break;
case MMJSON_ZEROSTR:
//printf("%s.zerostr\n",MM_fields[ind]);
jadd64bits(lineobj,MM_fields[ind],0);
//printf("%s.zerostr\n",fieldstr);
jadd64bits(lineobj,fieldstr,0);
break;
case MMJSON_COIN:
jaddstr(lineobj,MM_fields[ind],MM_coins[linebuf[i++]]);
jaddstr(lineobj,fieldstr,MM_coins[linebuf[i++]]);
break;
case MMJSON_STRING:
j = 0;
@ -260,14 +259,14 @@ int32_t MMJSON_decodeitem(cJSON *lineobj,uint8_t *linebuf,int32_t i,int32_t len,
arbstr[j++] = c;
}
arbstr[j] = 0;
jaddstr(lineobj,MM_fields[ind],arbstr);
jaddstr(lineobj,fieldstr,arbstr);
break;
default:
if ( valind < MMJSON_BOUNDARY )
jaddstr(lineobj,MM_fields[ind],MM_fields[valind]);
jaddstr(lineobj,fieldstr,MM_fields[valind]);
else
{
printf("%s unhandled valind.%d k.%d len.%d (%s)\n",MM_fields[ind],valind,i,len,jprint(lineobj,0));
printf("%s unhandled valind.%d k.%d len.%d (%s)\n",fieldstr,valind,i,len,jprint(lineobj,0));
free_json(lineobj);
return(-1);
}
@ -278,16 +277,26 @@ int32_t MMJSON_decodeitem(cJSON *lineobj,uint8_t *linebuf,int32_t i,int32_t len,
char *MMJSON_decode(uint8_t *linebuf,int32_t len)
{
uint32_t timestamp = 0; uint64_t l; int32_t ind,i=0,j,m=-1; cJSON *obj,*item,*array,*lineobj = cJSON_CreateObject();
uint32_t timestamp = 0; char *fieldstr; uint64_t l; int32_t ind,i=0,j,m=-1; cJSON *obj,*item,*array,*lineobj = cJSON_CreateObject();
while ( i+1 < len )
{
//printf("ind.%d i.%d vs len.%d\n",linebuf[i],i,len);
if ( (ind= linebuf[i++]) >= MMJSON_BOUNDARY )
{
printf("illegal field ind.%d (%s)\n",ind,jprint(lineobj,0));
free_json(lineobj);
return(0);
}
if ( ind != MMJSON_STRING )
{
printf("illegal field ind.%d (%s)\n",ind,jprint(lineobj,0));
free_json(lineobj);
return(0);
}
else
{
fieldstr = (char *)&linebuf[i++];
while ( linebuf[i] != 0 )
i++;
i++;
}
} else fieldstr = MM_fields[ind];
if ( linebuf[i] == MMJSON_ARRAY8 )
{
i++;
@ -307,27 +316,27 @@ char *MMJSON_decode(uint8_t *linebuf,int32_t len)
} else m = -1;
if ( m >= 0 )
{
//printf("%s i.%d m.%d\n",MM_fields[ind],i,m);
//printf("%s i.%d m.%d\n",fieldstr,i,m);
array = cJSON_CreateArray();
for (j=0; j<m; j++)
{
item = cJSON_CreateObject();
if ( (i= MMJSON_decodeitem(item,linebuf,i,len,ind,&timestamp)) < 0 )
if ( (i= MMJSON_decodeitem(item,linebuf,i,len,fieldstr,&timestamp)) < 0 )
{
printf("error decoding item ind.%d (%s)\n",ind,jprint(lineobj,0));
printf("error decoding item ind.%s (%s)\n",fieldstr,jprint(lineobj,0));
free_json(array);
free_json(lineobj);
return(0);
}
obj = jobj(item,MM_fields[ind]);
obj = jobj(item,fieldstr);
jaddi(array,jduplicate(obj));
free_json(item);
}
jadd(lineobj,MM_fields[ind],array);
jadd(lineobj,fieldstr,array);
}
else if ( (i= MMJSON_decodeitem(lineobj,linebuf,i,len,ind,&timestamp)) < 0 )
else if ( (i= MMJSON_decodeitem(lineobj,linebuf,i,len,fieldstr,&timestamp)) < 0 )
{
printf("error decoding item ind.%d (%s)\n",ind,jprint(lineobj,0));
printf("error decoding item ind.%s (%s)\n",fieldstr,jprint(lineobj,0));
free_json(lineobj);
return(0);
}
@ -336,13 +345,17 @@ char *MMJSON_decode(uint8_t *linebuf,int32_t len)
return(jprint(lineobj,1));
}
int32_t MMJSON_encodeval(uint8_t *linebuf,int32_t k,int32_t ind,char *v,uint32_t *timestampp,cJSON *ptr)
int32_t MMJSON_encodeval(uint8_t *linebuf,int32_t k,int32_t ind,char *v,uint32_t *timestampp,cJSON *ptr,char *fieldstr)
{
double val; char checkstr[512]; uint64_t l; int32_t valind,len,isstr,coinind,j,dots,diff;
if ( strcmp("utxocoin",MM_fields[ind]) == 0 || strcmp("alice",MM_fields[ind]) == 0 || strcmp("bob",MM_fields[ind]) == 0 || strcmp("base",MM_fields[ind]) == 0 || strcmp("rel",MM_fields[ind]) == 0 || strcmp("coin",MM_fields[ind]) == 0 || strcmp("txfee",MM_fields[ind]) == 0 || strcmp("desttxfee",MM_fields[ind]) == 0 || strcmp("price64",MM_fields[ind]) == 0 || strcmp("satoshis",MM_fields[ind]) == 0 || strcmp("destsatoshis",MM_fields[ind]) == 0 )
isstr = 1;
else isstr = 0;
//printf("%s.(%s) k.%d\n",MM_fields[ind],v,k);
double val; char checkstr[512]; uint64_t l; int32_t valind,len,isstr=0,coinind,j,dots,diff;
if ( ind >= 0 )
{
fieldstr = MM_fields[ind];
if ( strcmp("utxocoin",fieldstr) == 0 || strcmp("alice",fieldstr) == 0 || strcmp("bob",fieldstr) == 0 || strcmp("base",fieldstr) == 0 || strcmp("rel",fieldstr) == 0 || strcmp("coin",fieldstr) == 0 || strcmp("txfee",fieldstr) == 0 || strcmp("desttxfee",fieldstr) == 0 || strcmp("price64",fieldstr) == 0 || strcmp("satoshis",fieldstr) == 0 || strcmp("destsatoshis",fieldstr) == 0 )
isstr = 1;
else isstr = 0;
}
//printf("%s.(%s) k.%d\n",fieldstr,v,k);
if ( (valind= mmfind(v)) >= 0 )
{
linebuf[k++] = valind;
@ -435,12 +448,12 @@ int32_t MMJSON_encodeval(uint8_t *linebuf,int32_t k,int32_t ind,char *v,uint32_t
else if ( l < 0x1000000 )
{
linebuf[k++] = isstr != 0 ? MMJSON_DECIMAL24STR : MMJSON_DECIMAL24;
//printf("decimal24 %llu %s (%s) %d\n",(long long)l,v,MM_fields[ind],linebuf[k-1]);
//printf("decimal24 %llu %s (%s) %d\n",(long long)l,v,fieldstr,linebuf[k-1]);
k += MMJSON_rwnum(1,&linebuf[k],&l,3);
}
else if ( l < 0x100000000LL )
{
if ( v[0] != '"' && *timestampp == 0 && strcmp(MM_fields[ind],"timestamp") == 0 )
if ( v[0] != '"' && *timestampp == 0 && strcmp(fieldstr,"timestamp") == 0 )
{
*timestampp = (uint32_t)atol(v);
//printf("<timestamp> ");
@ -504,7 +517,7 @@ int32_t MMJSON_encodeval(uint8_t *linebuf,int32_t k,int32_t ind,char *v,uint32_t
if ( v[j] == 0 )
{
printf("unexpected missing string value.(%s)\n",v);
ind = mmadd(v);
//ind = mmadd(v);
//printf("%s.<%s>.%d ",s,v,ind);
//linebuf[k++] = ind;
linebuf[k++] = MMJSON_STRING;
@ -566,11 +579,11 @@ int32_t MMJSON_encode(uint8_t *linebuf,char *line)
s = jfieldname(ptr);
if ( (ind= mmfind(s)) < 0 )
{
printf("unexpected missing.(%s)\n",s);
printf("missing field.(%s) add to MM_fields[]\n",s);
linebuf[k++] = MMJSON_STRING;
memcpy(&linebuf[k],s,strlen(s)+1);
k += (int32_t)strlen(s) + 1;
ind = mmadd(s);
//ind = mmadd(s);
} else linebuf[k++] = ind;
//printf("%s ",s);
if ( (array= jobj(lineobj,s)) != 0 && is_cJSON_Array(array) != 0 )
@ -598,11 +611,11 @@ int32_t MMJSON_encode(uint8_t *linebuf,char *line)
if ( (v= jprint(jitem(array,z),0)) != 0 )
{
//printf("%d.(%s k.%d).%d ",z,v,k,asize);
k = MMJSON_encodeval(linebuf,k,ind,v,&timestamp,ptr);
k = MMJSON_encodeval(linebuf,k,ind,v,&timestamp,ptr,s);
free(v);
} else printf("ERROR.(%s) ",jprint(jitem(array,z),0));
}
//printf("%s array.%d k.%d\n",MM_fields[ind],asize,k);
//printf("%s array.%d k.%d\n",fieldstr,asize,k);
continue;
}
else if ( (v= jstr(lineobj,s)) == 0 )
@ -614,7 +627,7 @@ int32_t MMJSON_encode(uint8_t *linebuf,char *line)
if ( v != 0 )
{
//printf("%s\n",v);
k = MMJSON_encodeval(linebuf,k,ind,v,&timestamp,ptr);
k = MMJSON_encodeval(linebuf,k,ind,v,&timestamp,ptr,s);
}
else printf("ERROR.(%s) ",jprint(jobj(lineobj,s),0));
if ( allocv_flag != 0 && v != 0 )

2
iguana/exchanges/coins.json

File diff suppressed because one or more lines are too long

71
iguana/iguana_notary.c

@ -560,6 +560,77 @@ char NOTARY_CURRENCIES[][16] = { "USD", "EUR", "JPY", "GBP", "AUD", "CAD", "CHF"
"CNY", "RUB", "MXN", "BRL", "INR", "HKD", "TRY", "ZAR", "PLN", "NOK", "SEK", "DKK", "CZK", "HUF", "ILS", "KRW", "MYR", "PHP", "RON", "SGD", "THB", "BGN", "IDR", "HRK",
"REVS", "SUPERNET", "DEX", "PANGEA", "JUMBLR", "BET", "CRYPTO", "HODL", "BOTS", "MGW", "COQUI", "WLC", "KV", "CEAL", "MESH", "MNZ", "CHIPS", "MSHARK", "AXO", "ETOMIC", "BTCH" }; // "LTC",
void _iguana_notarystats(char *fname,int32_t totals[64],int32_t dispflag)
{
FILE *fp; uint64_t signedmask; long fpos,startfpos; int32_t i,height,iter,prevheight;
if ( (fp= fopen(fname,"rb")) != 0 )
{
printf("opened %s\n",fname);
startfpos = 0;
prevheight = -1;
for (iter=0; iter<2; iter++)
{
while ( 1 )
{
fpos = ftell(fp);
if (fread(&height,1,sizeof(height),fp) == sizeof(height) && fread(&signedmask,1,sizeof(signedmask),fp) == sizeof(signedmask) )
{
//printf("%6d %016llx\n",height,(long long)signedmask);
if ( height < prevheight )
{
startfpos = fpos;
if ( iter == 0 )
printf("found reversed height %d vs %d\n",height,prevheight);
else printf("fpos.%ld fatal unexpected height reversal %d vs %d\n",fpos,height,prevheight);
}
if ( iter == 1 && (height >= 180000 || strcmp(fname,"signedmasks") != 0) )
{
for (i=0; i<64; i++)
{
if ( ((1LL << i) & signedmask) != 0 )
{
totals[i]++;
if ( dispflag > 1 )
printf("%2d ",i);
}
}
if ( dispflag > 1 )
printf("height.%d %016llx %s\n",height,(long long)signedmask,fname);
}
prevheight = height;
} else break;
}
if ( iter == 0 )
{
prevheight = -1;
fseek(fp,startfpos,SEEK_SET);
printf("set startfpos %ld\n",startfpos);
}
}
fclose(fp);
if ( dispflag != 0 )
{
printf("after %s\n",fname);
for (i=0; i<64; i++)
{
if ( totals[i] != 0 )
printf("%s, %d\n",Notaries_elected[i][0],totals[i]);
}
}
} else printf("couldnt open.(%s)\n",fname);
}
void iguana_notarystats(int32_t totals[64],int32_t dispflag)
{
int32_t i; char fname[512];
_iguana_notarystats("signedmasks",totals,dispflag);
for (i=0; i<sizeof(NOTARY_CURRENCIES)/sizeof(*NOTARY_CURRENCIES); i++)
{
sprintf(fname,"%s/signedmasks",NOTARY_CURRENCIES[i]);
_iguana_notarystats(fname,totals,dispflag);
}
}
ZERO_ARGS(dpow,notarychains)
{
int32_t i; cJSON *array = cJSON_CreateArray();

26
iguana/main.c

@ -2198,11 +2198,19 @@ void iguana_main(void *arg)
{
if ( strcmp((char *)arg,"OStests") == 0 )
do_OStests = 1;
else if ( strcmp((char *)arg,"stats") == 0 )
{
void iguana_notarystats(int32_t totals[64],int32_t dispflag);
int32_t totals[64];
memset(totals,0,sizeof(totals));
iguana_notarystats(totals,1);
exit(0);
}
else if ( strcmp((char *)arg,"notary") == 0 )
{
myinfo->rpcport = IGUANA_NOTARYPORT;
myinfo->IAMNOTARY = 1;
myinfo->DEXEXPLORER = 1;
myinfo->DEXEXPLORER = 0;//1; disable as SPV is used now
}
else if ( strncmp((char *)arg,"-port=",6) == 0 )
{
@ -2262,22 +2270,6 @@ void iguana_main(void *arg)
{
basilisks_init(myinfo);
}
if ( (0) )
{
char *jsonstr = "[\"03b7621b44118017a16043f19b30cc8a4cfe068ac4e42417bae16ba460c80f3828\", \"02ebfc784a4ba768aad88d44d1045d240d47b26e248cafaf1c5169a42d7a61d344\", \"03750cf30d739cd7632f77c1c02812dd7a7181628b0558058d4755838117e05339\", \"0394f3529d2e8cc69ffa7a2b55f3761e7be978fa1896ef4c55dc9c275e77e5bf5e\", \"0243c1eeb3777af47187d542e5f8c84f0ac4b05cf5a7ad77faa8cb6d2d56db7823\", \"02bb298844175640a34e908ffdfa2839f77aba3d5edadefee16beb107826e00063\", \"02fa88e549b4b871498f892e527a5d57287916809f8cc3163f641d71c535e8df5a\", \"032f799e370f06476793a122fcd623db7804898fe5aef5572095cfee6353df34bf\", \"02c06fe5401faff4442ef87b7d1b56c2e5a214166615f9a2f2030c71b0cb067ae8\", \"038ac67ca49a8169bcc5de83fe020071095a2c3b2bc4d1c17386977329758956d5\"]";
int32_t i,n; char coinaddr[64]; uint8_t pubkey33[33]; double val = 0.1; cJSON *array;
if ( (array= cJSON_Parse(jsonstr)) != 0 )
{
n = cJSON_GetArraySize(array);
for (i=0; i<n; i++)
{
decode_hex(pubkey33,33,jstri(array,i));
bitcoin_address(coinaddr,60,pubkey33,33);
printf("./komodo-cli -ac_name=REVS sendtoaddress %s %f\n",coinaddr,val);
}
} else printf("couldnt parse.(%s)\n",jsonstr);
}
iguana_launchdaemons(myinfo);
}

Loading…
Cancel
Save