diff --git a/iguana/iguana_accept.c b/iguana/iguana_accept.c index e86c74bcf..2463a09a8 100755 --- a/iguana/iguana_accept.c +++ b/iguana/iguana_accept.c @@ -115,7 +115,7 @@ void iguana_acceptloop(void *args) printf("another daemon running, no need to have iguana accept connections\n"); return; } - //if ( port != IGUANA_RPCPORT ) + //if ( port != myinfo->rpcport ) // return; sleep(5); } diff --git a/iguana/iguana_json.c b/iguana/iguana_json.c index 7e38b1ad7..99d851641 100755 --- a/iguana/iguana_json.c +++ b/iguana/iguana_json.c @@ -18,7 +18,7 @@ cJSON *helpjson(cJSON *json,cJSON *array,cJSON *agents,char *agentstr,char *method,cJSON *methodargs) { - cJSON *methodobj,*item; int32_t i,n; char url[2048],curl[2048]; + cJSON *methodobj,*item; int32_t i,n; char url[2048],curl[2048]; struct supernet_info *myinfo = SuperNET_MYINFO(0); /*if ( *agentstrp == 0 || strcmp(*agentstrp,agentstr) != 0 ) { if ( array != 0 ) @@ -43,8 +43,8 @@ cJSON *helpjson(cJSON *json,cJSON *array,cJSON *agents,char *agentstr,char *meth methodobj = cJSON_CreateObject(); jaddstr(methodobj,"agent",agentstr); jaddstr(methodobj,"method",method); - sprintf(url,"http://127.0.0.1:7778/api/%s/%s",agentstr,method); - sprintf(curl,"curl --url \"http://127.0.0.1:7778\" --data \"{\\\"agent\\\":\\\"%s\\\",\\\"method\\\":\\\"%s\\\"",agentstr,method); + sprintf(url,"http://127.0.0.1:%u/api/%s/%s",myinfo->rpcport,agentstr,method); + sprintf(curl,"curl --url \"http://127.0.0.1:%u\" --data \"{\\\"agent\\\":\\\"%s\\\",\\\"method\\\":\\\"%s\\\"",myinfo->rpcport,agentstr,method); if ( methodargs != 0 && (n= cJSON_GetArraySize(methodargs)) > 0 ) { //printf("method.%s n.%d %s\n",method,n,jprint(methodargs,0)); @@ -203,7 +203,7 @@ cJSON *SuperNET_helpjson() int32_t agentform(FILE *fp,char *form,int32_t max,char *agent,cJSON *methoditem) { - cJSON *item,*fieldsarray; int32_t j,m,width=1,size = 0; + cJSON *item,*fieldsarray; int32_t j,m,width=1,size = 0; struct supernet_info *myinfo = SuperNET_MYINFO(0); char *methodstr,*typestr,outstr[2048],outstr2[2048],fields[8192],str[2],agent_method[256],*fieldname; form[0] = 0; if ( (methodstr= jstr(methoditem,"method")) == 0 ) @@ -252,7 +252,7 @@ int32_t agentform(FILE *fp,char *form,int32_t max,char *agent,cJSON *methoditem) //printf("fields[%d] (%s)\n",j,fields); } } else sprintf(fields+strlen(fields),"%s ",agent_method); - sprintf(&form[size],"
",agent,methodstr,outstr,fields,outstr2,methodstr); + sprintf(&form[size],"",myinfo->rpcport,agent,methodstr,outstr,fields,outstr2,methodstr); if ( fp != 0 ) fprintf(fp,"%s\n",&form[size]); //printf("%s\n",&form[size]); diff --git a/iguana/iguana_rpc.c b/iguana/iguana_rpc.c index 19d546676..20ad9aa78 100755 --- a/iguana/iguana_rpc.c +++ b/iguana/iguana_rpc.c @@ -759,7 +759,7 @@ char *iguana_bitcoinRPC(struct supernet_info *myinfo,char *method,cJSON *json,ch //printf("add params[%d] of %d <- (%s) %p.(%p %p)\n",i,n,jprint(params[i],0),params[i],params[i]->next,params[i]->prev); } } - retstr = iguana_bitcoinrpc(myinfo,IGUANA_RPCPORT,coin,method,params,n,json,remoteaddr,array); + retstr = iguana_bitcoinrpc(myinfo,myinfo->rpcport,coin,method,params,n,json,remoteaddr,array); if ( n > 0 ) for (i=0; i