Sync Linux tweaks.

This commit is contained in:
JoelKatz
2011-11-07 13:45:32 -08:00
parent beef9b47d5
commit 1d140e8829
19 changed files with 2674 additions and 48 deletions

View File

@@ -49,7 +49,8 @@ bool ValidationCollection::hasValidation(uint32 ledgerIndex,uint160& hanko,uint3
string hankoStr;
Database* db=theApp->getDB();
db->escape(hanko.begin(),hanko.GetSerializeSize(),hankoStr);
string sql=strprintf("SELECT ValidationID,seqnum from Validations where LedgerIndex=%d and hanko=%s",ledgerIndex,hankoStr);
string sql=strprintf("SELECT ValidationID,seqnum from Validations where LedgerIndex=%d and hanko=%s",
ledgerIndex,hankoStr.c_str());
if(db->executeSQL(sql.c_str()))
{
if(db->startIterRows())
@@ -195,6 +196,14 @@ void ValidationCollection::getValidations(uint32 ledgerIndex,vector<newcoin::Val
}
#if 0
In member function
bool ValidationCollection::getConsensusLedger(uint32, uint256&, Ledger::pointer&, uint256&):
invalid initialization of non-const reference of type std::vector<newcoin::Validation>& from
an rvalue of type std::vector<newcoin::Validation>
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
@@ -205,9 +214,9 @@ bool ValidationCollection::getConsensusLedger(uint32 ledgerIndex, uint256& ourHa
{
unsigned int maxVotes=theConfig.MIN_VOTES_FOR_CONSENSUS;
vector<newcoin::Validation>& mostValid=vector<newcoin::Validation>();
vector<newcoin::Validation>& mostValid=vector<newcoin::Validation>(); // DJS ERROR HERE
vector< Group >& groups=mIndexGroups[ledgerIndex];
Group& maxGroup=Group();
Group& maxGroup=Group(); // DJS ERROR HERE
BOOST_FOREACH(Group& group,groups)
{
if(group.mValidations.size()>maxVotes)
@@ -230,4 +239,5 @@ bool ValidationCollection::getConsensusLedger(uint32 ledgerIndex, uint256& ourHa
}
return(ret);
}
}
#endif