Consensus singleton and lock changes (RIPD-1054):

* Make LedgerConsensus object a singleton
* Protect consensus structures with their own locks
* Simplify NetworkOPs interaction with LedgerConsensus
* Log when we build and validate the same ledger
This commit is contained in:
JoelKatz
2015-11-23 16:54:10 -08:00
committed by Nik Bougalis
parent 2a97bd3848
commit bb944466f2
11 changed files with 351 additions and 335 deletions

View File

@@ -1917,13 +1917,7 @@ PeerImp::checkPropose (Job& job,
}
else
{
uint256 consensusLCL;
{
std::lock_guard<Application::MutexType> lock (app_.getMasterMutex());
consensusLCL = app_.getOPs ().getConsensusLCL ();
}
if (consensusLCL == proposal->getPrevLedger())
if (app_.getOPs().getConsensusLCL() == proposal->getPrevLedger())
{
// relay untrusted proposal
p_journal_.trace <<