From ca76173783074dd8295b0f7c94d317a4c2eba61b Mon Sep 17 00:00:00 2001 From: "Jonathan \"Duke\" Leto" Date: Sat, 15 Sep 2018 13:54:10 -0700 Subject: [PATCH] Improve calc_MoM rpc error messages --- src/komodo_rpcblockchain.h | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) diff --git a/src/komodo_rpcblockchain.h b/src/komodo_rpcblockchain.h index 4f68edf4c..a1b79cfc3 100644 --- a/src/komodo_rpcblockchain.h +++ b/src/komodo_rpcblockchain.h @@ -46,8 +46,11 @@ UniValue calc_MoM(const UniValue& params, bool fHelp) LOCK(cs_main); height = atoi(params[0].get_str().c_str()); MoMdepth = atoi(params[1].get_str().c_str()); - if ( height <= 0 || MoMdepth <= 0 || MoMdepth >= height ) - throw runtime_error("calc_MoM illegal height or MoMdepth\n"); + if ( height <= 0 ) + throw runtime_error("calc_MoM illegal height, must be positive\n"); + if ( MoMdepth <= 0 || MoMdepth >= height ) + throw runtime_error("calc_MoM illegal MoMdepth, must be positive and less than height\n"); + //fprintf(stderr,"height_MoM height.%d\n",height); MoM = komodo_calcMoM(height,MoMdepth); ret.push_back(Pair("coin",(char *)(ASSETCHAINS_SYMBOL[0] == 0 ? "KMD" : ASSETCHAINS_SYMBOL)));