mirror of
https://github.com/Xahau/xahaud.git
synced 2025-12-06 17:27:52 +00:00
Set the network state timer a bit later.
This commit is contained in:
@@ -564,7 +564,7 @@ Json::Value NetworkOPs::getOwnerInfo(Ledger::pointer lpLedger, const RippleAddre
|
|||||||
//
|
//
|
||||||
|
|
||||||
void NetworkOPs::setStateTimer()
|
void NetworkOPs::setStateTimer()
|
||||||
{ // set timer early if ledger is closing
|
{
|
||||||
mNetTimer.expires_from_now(boost::posix_time::milliseconds(LEDGER_GRANULARITY));
|
mNetTimer.expires_from_now(boost::posix_time::milliseconds(LEDGER_GRANULARITY));
|
||||||
mNetTimer.async_wait(boost::bind(&NetworkOPs::checkState, this, boost::asio::placeholders::error));
|
mNetTimer.async_wait(boost::bind(&NetworkOPs::checkState, this, boost::asio::placeholders::error));
|
||||||
}
|
}
|
||||||
@@ -594,10 +594,12 @@ void NetworkOPs::checkState(const boost::system::error_code& result)
|
|||||||
{ // Network state machine
|
{ // Network state machine
|
||||||
|
|
||||||
if ((result == boost::asio::error::operation_aborted) || theConfig.RUN_STANDALONE)
|
if ((result == boost::asio::error::operation_aborted) || theConfig.RUN_STANDALONE)
|
||||||
|
{
|
||||||
|
cLog(lsFATAL) << "Network state timer error: " << result;
|
||||||
return;
|
return;
|
||||||
|
}
|
||||||
|
|
||||||
setStateTimer();
|
{
|
||||||
|
|
||||||
ScopedLock(theApp->getMasterLock());
|
ScopedLock(theApp->getMasterLock());
|
||||||
|
|
||||||
std::vector<Peer::pointer> peerList = theApp->getConnectionPool().getPeerVector();
|
std::vector<Peer::pointer> peerList = theApp->getConnectionPool().getPeerVector();
|
||||||
@@ -624,6 +626,9 @@ void NetworkOPs::checkState(const boost::system::error_code& result)
|
|||||||
|
|
||||||
if (mConsensus)
|
if (mConsensus)
|
||||||
mConsensus->timerEntry();
|
mConsensus->timerEntry();
|
||||||
|
}
|
||||||
|
|
||||||
|
setStateTimer();
|
||||||
}
|
}
|
||||||
|
|
||||||
void NetworkOPs::tryStartConsensus()
|
void NetworkOPs::tryStartConsensus()
|
||||||
|
|||||||
Reference in New Issue
Block a user