Sendrawtransaction result
This commit is contained in:
@@ -711,13 +711,12 @@ char *komodo_issuemethod(char *userpass,char *method,char *params,uint16_t port)
|
||||
|
||||
int32_t rogue_sendrawtransaction(char *rawtx)
|
||||
{
|
||||
char *params,*retstr; cJSON *retjson; int32_t numconfs = -1;
|
||||
char *params,*retstr,*hexstr; cJSON *retjson; int32_t numconfs = -1;
|
||||
params = (char *)malloc(strlen(rawtx) + 16);
|
||||
sprintf(params,"[\"%s\"]",rawtx);
|
||||
if ( (retstr= komodo_issuemethod(USERPASS,"sendrawtransaction",params,ROGUE_PORT)) != 0 )
|
||||
{
|
||||
free(params);
|
||||
fprintf(stderr,"sendrawtransaction.(%s)\n",retstr);
|
||||
{
|
||||
static FILE *fp;
|
||||
if ( fp == 0 )
|
||||
@@ -728,13 +727,16 @@ int32_t rogue_sendrawtransaction(char *rawtx)
|
||||
fflush(fp);
|
||||
}
|
||||
}
|
||||
if ( is_hexstr(retstr,64) == 64 )
|
||||
{
|
||||
free(retstr);
|
||||
return(0);
|
||||
}
|
||||
if ( (retjson= cJSON_Parse(retstr)) != 0 )
|
||||
{
|
||||
if ( (resobj= jobj(retjson,"result")) != 0 )
|
||||
{
|
||||
if ( (hexstr= jstr(resobj,0)) != 0 && is_hexstr(hexstr,64) == 64 )
|
||||
{
|
||||
free(retstr);
|
||||
return(0);
|
||||
}
|
||||
}
|
||||
free_json(retjson);
|
||||
}
|
||||
free(retstr);
|
||||
|
||||
Reference in New Issue
Block a user