Browse Source

Amazing how jl777 does not care about the difference between STDERR and STDOUT

master
Duke Leto 4 years ago
parent
commit
55e774b659
  1. 9
      dragon/dragon_rpc.c

9
dragon/dragon_rpc.c

@ -17,7 +17,6 @@
#define WHITELIST_IPADDR ""
#include "dragon.h"
//#include "SuperNET.h"
#define RPCARGS struct supernet_info *myinfo,uint16_t port,struct dragon_info *coin,cJSON *params[],int32_t n,cJSON *json,char *remoteaddr,cJSON *array,char *userpass
#define GLUEARGS cJSON *json,struct supernet_info *myinfo,uint16_t port,struct dragon_info *coin,char *remoteaddr,cJSON *params[],char *userpass
@ -29,7 +28,7 @@ char *sglue(GLUEARGS,char *agent,char *method)
char *retstr,*rpcretstr,*walletstr,checkstr[65],dcheckstr[65]; cJSON *retjson,*tmpjson,*result,*error,*wallet; int32_t i,j,len; int64_t val; double dval;
if ( json == 0 )
json = cJSON_CreateObject();
//printf("userpass.(%s)\n",userpass);
//printf("userpass.(%s)\n",userpass);
jaddstr(json,"agent",agent);
jaddstr(json,"method",method);
if ( coin != 0 )
@ -40,7 +39,7 @@ char *sglue(GLUEARGS,char *agent,char *method)
{
if ( userpass == 0 || strcmp(userpass,coin->chain->userpass) != 0 )
{
printf("dragon authentication error {%s} (%s) != (%s)\n",jprint(json,0),userpass,coin->chain->userpass);
fprintf(stderr,"dragon authentication error {%s} (%s) != (%s)\n",jprint(json,0),userpass,coin->chain->userpass);
return(clonestr("{\"error\":\"authentication error\"}"));
}
}
@ -70,8 +69,8 @@ char *sglue(GLUEARGS,char *agent,char *method)
} else printf("error parsing decryptstr\n");
if ( walletstr != 0 )
free(walletstr);
} else printf("ERROR: dirty wallet is unsaved, dragon_payloadupdate error\n");
} else printf("ERROR: dirty wallet is unsaved, unlock wallet\n");
} else fprintf(stderr,"ERROR: dirty wallet is unsaved, dragon_payloadupdate error\n");
} else fprintf(stderr,"ERROR: dirty wallet is unsaved, unlock wallet\n");
}
if ( jobj(retjson,"tag") != 0 )
jdelete(retjson,"tag");

Loading…
Cancel
Save