Browse Source

fix

blackjok3r
blackjok3r 6 years ago
parent
commit
a5daea1aec
  1. 25
      iguana/dpow/dpow_rpc.c

25
iguana/dpow/dpow_rpc.c

@ -111,27 +111,17 @@ int32_t Notaries_minsigs = DPOW_MIN_ASSETCHAIN_SIGS;
uint16_t Notaries_port = DPOW_SOCKPORT; uint16_t Notaries_port = DPOW_SOCKPORT;
char *Notaries_seeds[65]; char *Notaries_seeds[65];
int32_t komodo_initjson(char *fname)
{
char *fstr; long fsize; int32_t retval = -1;
if ( (fstr= OS_filestr(&fsize,fname)) != 0 )
{
retval = komodo_initjson2(fstr);
free(fstr);
}
return(retval);
}
int32_t komodo_initjson2(char *fstr) int32_t komodo_initjson2(char *fstr)
{ {
char *field,*hexstr; cJSON *array,*item,*argjson; uint16_t port; int32_t i,n,num,retval = -1;
static portable_mutex_t notaries_mutex; static int32_t initflag; static portable_mutex_t notaries_mutex; static int32_t initflag;
if ( initflag == 0 ) if ( initflag == 0 )
{ {
portable_mutex_init(&notaries_mutex); portable_mutex_init(&notaries_mutex);
initflag = 1; initflag = 1;
} }
portable_mutex_lock(&notaries_mutex); portable_mutex_lock(&notaries_mutex);
char *field,*hexstr; cJSON *array,*item,*argjson; uint16_t port; int32_t i,n,numretval = -1;
if ( (argjson= cJSON_Parse(fstr)) != 0 ) if ( (argjson= cJSON_Parse(fstr)) != 0 )
{ {
// memset arrays to 0! // memset arrays to 0!
@ -183,6 +173,17 @@ int32_t komodo_initjson2(char *fstr)
portable_mutex_unlock(&notaries_mutex); portable_mutex_unlock(&notaries_mutex);
} }
int32_t komodo_initjson(char *fname)
{
char *fstr; long fsize; int32_t retval = -1;
if ( (fstr= OS_filestr(&fsize,fname)) != 0 )
{
retval = komodo_initjson2(fstr);
free(fstr);
}
return(retval);
}
int32_t komodo_notaries(char *symbol,uint8_t pubkeys[64][33],int32_t height) int32_t komodo_notaries(char *symbol,uint8_t pubkeys[64][33],int32_t height)
{ {
int32_t i,num=-1, didinit=0; struct iguana_info *coin; char params[64],*retstr; cJSON *retjson; int32_t i,num=-1, didinit=0; struct iguana_info *coin; char params[64],*retstr; cJSON *retjson;

Loading…
Cancel
Save