ELB support. Client servers can remove themselves from an ELB pool if loaded

or otherwise broken. Clients won't join an ELB pool until they're stable.
This commit is contained in:
JoelKatz
2013-05-29 15:20:26 -07:00
parent 130459dcca
commit a0b6584c9a
5 changed files with 53 additions and 5 deletions

View File

@@ -507,4 +507,36 @@ bool Application::loadOldLedger(const std::string& l)
return true;
}
bool serverOkay(std::string& reason)
{
if (!theConfig.ELB_SUPPORT)
return true;
if (!theApp)
{
reason = "Server has not started";
return false;
}
if (theApp->getOPs().isNeedNetworkLedger())
{
reason = "Not synchronized with network yet";
return false;
}
if (theApp->getOPs().getOperatingMode() < NetworkOPs::omSYNCING)
{
reason = "Not synchronized with network";
return false;
}
if (theApp->getFeeTrack().isLoaded())
{
reason = "Too much load";
return false;
}
return true;
}
// vim:ts=4