Browse Source

Merge pull request #800 from jl777/jl777

Jl777
patch-3
jl777 7 years ago
committed by GitHub
parent
commit
eda99ecc8d
No known key found for this signature in database GPG Key ID: 4AEE18F83AFDEB23
  1. 12
      iguana/iguana_notary.c

12
iguana/iguana_notary.c

@ -861,7 +861,9 @@ extern char *Notaries_elected[65][2];
STRING_ARG(dpow,active,maskhex)
{
uint8_t data[8],revdata[8],pubkeys[64][33]; char pubkeystr[67]; int32_t i,len,current,n; uint64_t mask; cJSON *infojson,*retjson,*array = cJSON_CreateArray();
uint8_t data[8],revdata[8],pubkeys[64][33]; char pubkeystr[67]; int32_t i,len,current,n; uint64_t mask; cJSON *infojson,*retjson,*array,*notarray;
array = cJSON_CreateArray();
notarray = cJSON_CreateArray();
if ( (infojson= dpow_getinfo(myinfo,coin)) != 0 )
{
current = jint(infojson,"blocks");
@ -899,13 +901,19 @@ STRING_ARG(dpow,active,maskhex)
// printf("%02x",data[i]);
//printf(" <- hex mask.%llx\n",(long long)mask);
for (i=0; i<(len<<3); i++)
{
if ( ((1LL << i) & mask) != 0 )
{
//init_hexbytes_noT(pubkeystr,pubkeys[i],33);
//printf("(%d %llx %s) ",i,(long long)(1LL << i),pubkeystr);
jaddistr(array,Notaries_elected[i][0]);
}
return(jprint(array,1));
else jaddistr(notarray,Notaries_elected[i][0]);
}
retjson = cJSON_CreateObject();
jadd(retjson,"set",array);
jadd(retjson,"not",notarray);
return(jprint(retjson,1));
} else return(clonestr("{\"error\":\"maskhex too long\"}"));
}

Loading…
Cancel
Save