From 4bf1e52c7bf3eeee6514a94e6063e57cc08e3c5b Mon Sep 17 00:00:00 2001 From: JoelKatz Date: Mon, 7 Nov 2011 13:57:27 -0800 Subject: [PATCH] Put back the code I commented out. Fix the non-const reference bound to a temporary. --- ValidationCollection.cpp | 15 +++------------ 1 file changed, 3 insertions(+), 12 deletions(-) diff --git a/ValidationCollection.cpp b/ValidationCollection.cpp index 5d65a9050f..c61a69d9ec 100644 --- a/ValidationCollection.cpp +++ b/ValidationCollection.cpp @@ -196,14 +196,6 @@ void ValidationCollection::getValidations(uint32 ledgerIndex,vector&’ from - an rvalue of type ‘std::vector’ -invalid initialization of non-const reference of type ‘ValidationCollection::Group&’ from - an rvalue of type ‘ValidationCollection::Group’ - // look through all the validated hashes at that index // put the ledgers into compatible groups // Pick the group with the most votes @@ -214,10 +206,10 @@ bool ValidationCollection::getConsensusLedger(uint32 ledgerIndex, uint256& ourHa { unsigned int maxVotes=theConfig.MIN_VOTES_FOR_CONSENSUS; - vector& mostValid=vector(); // DJS ERROR HERE vector< Group >& groups=mIndexGroups[ledgerIndex]; - Group& maxGroup=Group(); // DJS ERROR HERE - BOOST_FOREACH(Group& group,groups) + Group empty; + Group& maxGroup=empty; + BOOST_FOREACH(Group& group, groups) { if(group.mValidations.size()>maxVotes) { @@ -240,4 +232,3 @@ bool ValidationCollection::getConsensusLedger(uint32 ledgerIndex, uint256& ourHa return(ret); } -#endif