Fix crash on missing method
This commit is contained in:
@@ -369,7 +369,7 @@ UniValue CClib(struct CCcontract_info *cp,char *method,char *jsonstr)
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
result.push_back(Pair("result","error"));
|
result.push_back(Pair("result","error"));
|
||||||
result.push_back(Pair("method",CClib_methods[i].method));
|
result.push_back(Pair("method",method));
|
||||||
result.push_back(Pair("error","method not found"));
|
result.push_back(Pair("error","method not found"));
|
||||||
return(result);
|
return(result);
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -110,7 +110,6 @@ if ( cp->evalcode == EVAL_GAMES ) \
|
|||||||
return(games_settle(txfee,cp,params)); \
|
return(games_settle(txfee,cp,params)); \
|
||||||
else \
|
else \
|
||||||
{ \
|
{ \
|
||||||
fprintf(stderr,"invalid method (%s)\n",method); \
|
|
||||||
result.push_back(Pair("result","error")); \
|
result.push_back(Pair("result","error")); \
|
||||||
result.push_back(Pair("error","invalid gamescc method")); \
|
result.push_back(Pair("error","invalid gamescc method")); \
|
||||||
return(result); \
|
return(result); \
|
||||||
|
|||||||
Reference in New Issue
Block a user