Provide --testnet status to API.

This commit is contained in:
Arthur Britto
2013-01-02 22:57:11 -08:00
parent 511587da5d
commit e7e16e5c75

View File

@@ -1079,6 +1079,9 @@ Json::Value NetworkOPs::getServerInfo()
{ {
Json::Value info = Json::objectValue; Json::Value info = Json::objectValue;
if (theConfig.TESTNET)
info["testnet"] = theConfig.TESTNET;
switch (mMode) switch (mMode)
{ {
case omDISCONNECTED: info["serverState"] = "disconnected"; break; case omDISCONNECTED: info["serverState"] = "disconnected"; break;
@@ -1462,8 +1465,12 @@ bool NetworkOPs::subServer(InfoSub* ispListener, Json::Value& jvResult)
{ {
uint256 uRandom; uint256 uRandom;
if (theConfig.RUN_STANDALONE)
jvResult["stand_alone"] = theConfig.RUN_STANDALONE; jvResult["stand_alone"] = theConfig.RUN_STANDALONE;
if (theConfig.TESTNET)
jvResult["testnet"] = theConfig.TESTNET;
getRand(uRandom.begin(), uRandom.size()); getRand(uRandom.begin(), uRandom.size());
jvResult["random"] = uRandom.ToString(); jvResult["random"] = uRandom.ToString();
jvResult["server_status"] = strOperatingMode(); jvResult["server_status"] = strOperatingMode();