mirror of
https://github.com/XRPLF/rippled.git
synced 2025-11-28 23:15:52 +00:00
Make unneeded code a compilation option.
This commit is contained in:
@@ -9,6 +9,8 @@
|
||||
#include <string>
|
||||
#include <boost/filesystem.hpp>
|
||||
|
||||
#define ENABLE_INSECURE 0 // 1, to enable unnecessary features.
|
||||
|
||||
#define SYSTEM_NAME "ripple"
|
||||
#define SYSTEM_CURRENCY_CODE "XRP"
|
||||
#define SYSTEM_CURRENCY_PRECISION 6
|
||||
|
||||
@@ -304,6 +304,7 @@ Json::Value RPCHandler::doConnect(Json::Value jvRequest)
|
||||
return "connecting";
|
||||
}
|
||||
|
||||
#if ENABLE_INSECURE
|
||||
// {
|
||||
// key: <string>
|
||||
// }
|
||||
@@ -327,7 +328,9 @@ Json::Value RPCHandler::doDataDelete(Json::Value jvRequest)
|
||||
|
||||
return ret;
|
||||
}
|
||||
#endif
|
||||
|
||||
#if ENABLE_INSECURE
|
||||
// {
|
||||
// key: <string>
|
||||
// }
|
||||
@@ -347,7 +350,9 @@ Json::Value RPCHandler::doDataFetch(Json::Value jvRequest)
|
||||
|
||||
return ret;
|
||||
}
|
||||
#endif
|
||||
|
||||
#if ENABLE_INSECURE
|
||||
// {
|
||||
// key: <string>
|
||||
// value: <string>
|
||||
@@ -375,6 +380,7 @@ Json::Value RPCHandler::doDataStore(Json::Value jvRequest)
|
||||
|
||||
return ret;
|
||||
}
|
||||
#endif
|
||||
|
||||
#if 0
|
||||
// XXX Needs to be revised for new paradigm
|
||||
@@ -1569,6 +1575,7 @@ Json::Value RPCHandler::doWalletSeed(Json::Value jvRequest)
|
||||
}
|
||||
}
|
||||
|
||||
#if ENABLE_INSECURE
|
||||
// TODO: for now this simply checks if this is the admin account
|
||||
// TODO: need to prevent them hammering this over and over
|
||||
// TODO: maybe a better way is only allow admin from local host
|
||||
@@ -1592,6 +1599,7 @@ Json::Value RPCHandler::doLogin(Json::Value jvRequest)
|
||||
return "nope";
|
||||
}
|
||||
}
|
||||
#endif
|
||||
|
||||
// {
|
||||
// min_count: <number> // optional, defaults to 10
|
||||
@@ -2456,11 +2464,13 @@ Json::Value RPCHandler::doCommand(Json::Value& jvRequest, int iRole)
|
||||
{ "wallet_propose", &RPCHandler::doWalletPropose, false, optNone },
|
||||
{ "wallet_seed", &RPCHandler::doWalletSeed, false, optNone },
|
||||
|
||||
#if ENABLE_INSECURE
|
||||
// XXX Unnecessary commands which should be removed.
|
||||
{ "login", &RPCHandler::doLogin, true, optNone },
|
||||
{ "data_delete", &RPCHandler::doDataDelete, true, optNone },
|
||||
{ "data_fetch", &RPCHandler::doDataFetch, true, optNone },
|
||||
{ "data_store", &RPCHandler::doDataStore, true, optNone },
|
||||
#endif
|
||||
|
||||
// Evented methods
|
||||
{ "subscribe", &RPCHandler::doSubscribe, false, optNone },
|
||||
|
||||
@@ -40,9 +40,11 @@ class RPCHandler
|
||||
Json::Value doAccountOffers(Json::Value params);
|
||||
Json::Value doAccountTransactions(Json::Value params);
|
||||
Json::Value doConnect(Json::Value params);
|
||||
#if ENABLE_INSECURE
|
||||
Json::Value doDataDelete(Json::Value params);
|
||||
Json::Value doDataFetch(Json::Value params);
|
||||
Json::Value doDataStore(Json::Value params);
|
||||
#endif
|
||||
Json::Value doGetCounts(Json::Value params);
|
||||
Json::Value doLedger(Json::Value params);
|
||||
Json::Value doLogLevel(Json::Value params);
|
||||
@@ -79,7 +81,9 @@ class RPCHandler
|
||||
Json::Value doWalletUnlock(Json::Value params);
|
||||
Json::Value doWalletVerify(Json::Value params);
|
||||
|
||||
#if ENABLE_INSECURE
|
||||
Json::Value doLogin(Json::Value params);
|
||||
#endif
|
||||
|
||||
Json::Value doLedgerAccept(Json::Value params);
|
||||
Json::Value doLedgerClosed(Json::Value params);
|
||||
|
||||
Reference in New Issue
Block a user