diff --git a/src/komodo_ccdata.h b/src/komodo_ccdata.h index 15b1086ca..c3978414b 100644 --- a/src/komodo_ccdata.h +++ b/src/komodo_ccdata.h @@ -113,6 +113,7 @@ char *komodo_MoMoMdata(char *symbol,int32_t kmdheight,int32_t notarized_height) if ( tree != 0 ) free(tree); jadd(retjson,(char *)"offsets",pairs); + fprintf(stderr,"%s\n",jprint(retjson,0)); return(jprint(retjson,1)); } diff --git a/src/rpcblockchain.cpp b/src/rpcblockchain.cpp index 108efdd03..4581424c1 100644 --- a/src/rpcblockchain.cpp +++ b/src/rpcblockchain.cpp @@ -592,21 +592,28 @@ UniValue kvsearch(const UniValue& params, bool fHelp) UniValue MoMoMdata(const UniValue& params, bool fHelp) { - char *symbol; int32_t kmdheight,notarized_height; UniValue ret(UniValue::VOBJ); UniValue a(UniValue::VARR); + char *symbol,*retstr; int32_t kmdheight,notarized_height; UniValue ret(UniValue::VOBJ); UniValue a(UniValue::VARR); if ( fHelp || params.size() != 3 ) - throw runtime_error("height_MoM needs symbol kmdheight notarized_height\n"); + throw runtime_error("MoMoMdata symbol kmdheight notarized_height\n"); LOCK(cs_main); symbol = (char *)params[0].get_str().c_str(); kmdheight = atoi(params[1].get_str().c_str()); notarized_height = atoi(params[2].get_str().c_str()); - return((UniValue)komodo_MoMoMdata(symbol,kmdheight,notarized_height)); + if ( (retstr= komodo_MoMoMdata(symbol,kmdheight,notarized_height)) != 0 ) + { + ret.push_back(Pair("coin",symbol)); + ret.push_back(Pair("kmdheight",kmdheight)); + ret.push_back(Pair("notarized_height",notarized_height)); + free(retstr); + } + return(ret); } UniValue height_MoM(const UniValue& params, bool fHelp) { int32_t height,depth,notarized_height; uint256 MoM,kmdtxid; uint32_t timestamp = 0; UniValue ret(UniValue::VOBJ); UniValue a(UniValue::VARR); if ( fHelp || params.size() != 1 ) - throw runtime_error("height_MoM needs height\n"); + throw runtime_error("height_MoM height\n"); LOCK(cs_main); height = atoi(params[0].get_str().c_str()); if ( height <= 0 )