Fix not leaving the "need network ledger" state correctly.

This commit is contained in:
JoelKatz
2013-01-04 00:08:27 -08:00
parent aee92a447c
commit 06c54c425c
4 changed files with 3 additions and 13 deletions

View File

@@ -439,7 +439,6 @@ Json::Value RPCParser::parseCommand(std::string strMethod, Json::Value jvParams)
// { "ripple_path_find", &RPCParser::parseRipplePathFind, -1, -1 },
{ "submit", &RPCParser::parseSubmit, 2, 2 },
{ "server_info", &RPCParser::parseAsIs, 0, 0 },
{ "ledger_okay", &RPCParser::parseAsIs, 0, 0 },
{ "stop", &RPCParser::parseAsIs, 0, 0 },
// { "transaction_entry", &RPCParser::parseTransactionEntry, -1, -1 },
{ "tx", &RPCParser::parseTx, 1, 1 },

View File

@@ -338,6 +338,8 @@ void LedgerMaster::checkPublish(const uint256& hash, uint32 seq)
if (theConfig.RUN_STANDALONE)
minVal = 0;
else if (theApp->getOPs().isNeedNetworkLedger())
minVal = 1;
cLog(lsTRACE) << "Sweeping for ledgers to publish: minval=" << minVal;
@@ -347,6 +349,7 @@ void LedgerMaster::checkPublish(const uint256& hash, uint32 seq)
Ledger::pointer ledger = mLedgerHistory.getLedgerBySeq(seq);
if (ledger && (theApp->getValidations().getTrustedValidationCount(ledger->getHash()) >= minVal))
{ // this ledger (and any priors) can be published
theApp->getOPs().clearNeedNetworkLedger();
if (ledger->getLedgerSeq() > (mLastValidateSeq + MAX_LEDGER_GAP))
mLastValidateSeq = ledger->getLedgerSeq() - MAX_LEDGER_GAP;

View File

@@ -1160,16 +1160,6 @@ Json::Value RPCHandler::doSubmit(Json::Value jvRequest)
}
}
Json::Value RPCHandler::doLedgerOkay(Json::Value)
{
theApp->getOPs().clearNeedNetworkLedger();
Json::Value ret(Json::objectValue);
ret["okay"] = true;
return ret;
}
Json::Value RPCHandler::doServerInfo(Json::Value)
{
Json::Value ret(Json::objectValue);
@@ -2457,7 +2447,6 @@ Json::Value RPCHandler::doCommand(Json::Value& jvRequest, int iRole)
{ "ripple_path_find", &RPCHandler::doRipplePathFind, false, optCurrent },
{ "submit", &RPCHandler::doSubmit, false, optCurrent },
{ "server_info", &RPCHandler::doServerInfo, true, optNone },
{ "ledger_okay", &RPCHandler::doLedgerOkay, true, optNone },
{ "stop", &RPCHandler::doStop, true, optNone },
{ "transaction_entry", &RPCHandler::doTransactionEntry, false, optCurrent },
{ "tx", &RPCHandler::doTx, false, optNetwork },

View File

@@ -90,7 +90,6 @@ class RPCHandler
Json::Value doSubscribe(Json::Value params);
Json::Value doUnsubscribe(Json::Value params);
Json::Value doLedgerOkay(Json::Value params);
public: