From 79d39e3cef9c08a9f37129e963315e26664c2a78 Mon Sep 17 00:00:00 2001 From: jl777 Date: Mon, 30 Apr 2018 14:13:08 +0300 Subject: [PATCH] Active api --- iguana/iguana_notary.c | 18 ++++++++++-------- iguana/tests/active | 2 ++ 2 files changed, 12 insertions(+), 8 deletions(-) create mode 100755 iguana/tests/active diff --git a/iguana/iguana_notary.c b/iguana/iguana_notary.c index ecb45b3a7..7be7fca29 100755 --- a/iguana/iguana_notary.c +++ b/iguana/iguana_notary.c @@ -857,6 +857,8 @@ STRING_AND_INT(dpow,fundnotaries,symbol,numblocks) return(clonestr("{\"result\":\"success\"}")); } +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(); @@ -874,7 +876,7 @@ STRING_ARG(dpow,active,maskhex) if ( ((1LL << i) & mask) != 0 ) { init_hexbytes_noT(pubkeystr,pubkeys[i],33); - printf("(%d %llx %s) ",i,(long long)(1LL << i),pubkeystr); + //printf("(%d %llx %s) ",i,(long long)(1LL << i),pubkeystr); jaddistr(array,pubkeystr); } } @@ -883,7 +885,7 @@ STRING_ARG(dpow,active,maskhex) jadd(retjson,"notaries",array); return(jprint(retjson,1)); } - printf("dpow active (%s)\n",maskhex); + //printf("dpow active (%s)\n",maskhex); if ( (len= (int32_t)strlen(maskhex)) <= 16 ) { len >>= 1; @@ -893,15 +895,15 @@ STRING_ARG(dpow,active,maskhex) revdata[i] = data[len-1-i]; mask = 0; memcpy(&mask,revdata,sizeof(revdata)); - for (i=0; i