diff --git a/src/RPCServer.cpp b/src/RPCServer.cpp index b8d53a884..a8188edad 100644 --- a/src/RPCServer.cpp +++ b/src/RPCServer.cpp @@ -172,53 +172,6 @@ NewcoinAddress RPCServer::parseFamily(const std::string& fParam) return family; } -#if 0 -Json::Value RPCServer::doCreateFamily(Json::Value& params) -{ - // createfamily FXXXX - // createfamily fXXXX - // createfamily "" - // createfamily - - std::string query; - NewcoinAddress family; - NewcoinAddress seed; - - if (!extractString(query, params, 0)) - { - // No parameters, generate a family from a random seed. - family=theApp->getWallet().addRandomFamily(seed); - } - else if (seed.setFamilySeed(query)) - { - // Had a family seed. - family=theApp->getWallet().addFamily(seed, false); - } - else if (family.setFamilyGenerator(query)) - { - // Had a public generator - family=theApp->getWallet().addFamily(family); - } - else - { - // Must be a pass phrase. - family=theApp->getWallet().addFamily(query, false); - } - - if (!family.isValid()) - return JSONRPCError(500, "Invalid family specifier"); - - Json::Value ret(theApp->getWallet().getFamilyJson(family)); - if (ret.isNull()) return JSONRPCError(500, "Invalid family"); - if (seed.isValid()) - { - ret["FamilySeed"]=seed.humanFamilySeed(); - } - - return ret; -} -#endif - // account_info || // account_info || [] Json::Value RPCServer::doAccountInfo(Json::Value ¶ms) @@ -294,23 +247,6 @@ Json::Value RPCServer::doAccountInfo(Json::Value ¶ms) } #if 0 -Json::Value RPCServer::doNewAccount(Json::Value ¶ms) -{ // newaccount [] - std::string fParam; - if (!extractString(fParam, params, 0)) - return JSONRPCError(500, "Family required"); - - NewcoinAddress family = parseFamily(fParam); - if (!family.isValid()) return JSONRPCError(500, "Family not found."); - - LocalAccount::pointer account(theApp->getWallet().getNewLocalAccount(family)); - if (!account) - return JSONRPCError(500, "Family not found"); - - return account->getJson(); -} -#endif - Json::Value RPCServer::doLock(Json::Value ¶ms) { // lock // lock @@ -359,57 +295,7 @@ Json::Value RPCServer::doUnlock(Json::Value ¶ms) return ret; } - -Json::Value RPCServer::doFamilyInfo(Json::Value ¶ms) -{ - // familyinfo - // familyinfo - // familyinfo - int paramCount=getParamCount(params); - - if (paramCount==0) - { - std::vector familyIDs; - theApp->getWallet().getFamilies(familyIDs); - - Json::Value ret(Json::arrayValue); - BOOST_FOREACH(const NewcoinAddress& fid, familyIDs) - { - Json::Value obj(theApp->getWallet().getFamilyJson(fid)); - if (!obj.isNull()) ret.append(obj); - } - return ret; - } - - if (paramCount>2) return JSONRPCError(500, "Invalid parameters"); - std::string fParam; - extractString(fParam, params, 0); - - NewcoinAddress family=parseFamily(fParam); - if (!family.isValid()) return JSONRPCError(500, "No such family"); - - Json::Value obj(theApp->getWallet().getFamilyJson(family)); - if (obj.isNull()) - return JSONRPCError(500, "Family not found"); - - if (paramCount==2) - { - std::string keyNum; - extractString(keyNum, params, 1); - int kn=boost::lexical_cast(keyNum); - NewcoinAddress k=theApp->getWallet().peekKey(family, kn); - - if (k.isValid()) - { - Json::Value key(Json::objectValue); - key["Number"]=kn; - key["Address"]=k.humanAccountID(); - obj["Account"]=key; - } - } - - return obj; -} +#endif Json::Value RPCServer::doConnect(Json::Value& params) { @@ -918,9 +804,6 @@ Json::Value RPCServer::doCommand(const std::string& command, Json::Value& params // Obsolete or need rewrite: // -// if (command=="createfamily") return doCreateFamily(params); - if (command=="familyinfo") return doFamilyInfo(params); -// if (command=="newaccount") return doNewAccount(params); if (command=="lock") return doLock(params); if (command=="unlock") return doUnlock(params); if (command=="sendto") return doSendTo(params); diff --git a/src/RPCServer.h b/src/RPCServer.h index 904603dcd..07bebf172 100644 --- a/src/RPCServer.h +++ b/src/RPCServer.h @@ -33,10 +33,7 @@ class RPCServer : public boost::enable_shared_from_this NewcoinAddress parseFamily(const std::string& family); - Json::Value doCreateFamily(Json::Value& params); - Json::Value doFamilyInfo(Json::Value& params); Json::Value doAccountInfo(Json::Value& params); - Json::Value doNewAccount(Json::Value& params); Json::Value doLock(Json::Value& params); Json::Value doUnlock(Json::Value& params); Json::Value doSendTo(Json::Value& params); diff --git a/src/main.cpp b/src/main.cpp index 95181c49d..66dd94c31 100644 --- a/src/main.cpp +++ b/src/main.cpp @@ -40,9 +40,7 @@ void printHelp(const po::options_description& desc) cout << " account_info |" << endl; cout << " account_info || []" << endl; cout << " connect []" << endl; - cout << " familyinfo" << endl; cout << " ledger" << endl; - cout << " lock " << endl; cout << " peers" << endl; cout << " sendto []" << endl; cout << " stop" << endl; @@ -51,7 +49,6 @@ void printHelp(const po::options_description& desc) cout << " unl_delete " << endl; cout << " unl_list" << endl; cout << " unl_reset" << endl; - cout << " unlock " << endl; cout << " validation_create [||]" << endl; cout << " wallet_claim [] []" << endl; cout << " wallet_propose" << endl;