Bugfixes.

This commit is contained in:
JoelKatz
2012-06-09 18:14:32 -07:00
parent 9739eea860
commit 8d8d2c6691

View File

@@ -731,7 +731,7 @@ void LedgerConsensus::accept(SHAMap::pointer set)
// Insert the transactions in set into the AcctTxn database
Database *db = theApp->getAcctTxnDB()->getDB();
ScopedLock dbLock = theApp->getAcctTxnDB()->getDBLock();
db->executeSQL("BEGIN TRANSACTION");
db->executeSQL("BEGIN TRANSACTION;");
for (SHAMapItem::pointer item = set->peekFirstItem(); !!item; item = set->peekNextItem(item->getTag()))
{
SerializerIterator sit(item->peekSerializer());
@@ -742,19 +742,25 @@ void LedgerConsensus::accept(SHAMap::pointer set)
bool first = true;
for (std::vector<NewcoinAddress>::iterator it = accts.begin(), end = accts.end(); it != end; ++it)
{
if (!first) sql += ", (";
else sql += "(";
if (!first)
sql += ", (";
else
{
sql += "('";
first = false;
}
sql += txn.getTransactionID().GetHex();
sql += ",";
sql += "','";
sql += it->humanAccountID();
sql += ",";
sql += "','";
sql += boost::lexical_cast<std::string>(newLedgerSeq);
sql += ")";
sql += "')";
}
sql += ";";
Log(lsTRACE) << "ActTx: " << sql;
db->executeSQL(sql);
}
db->executeSQL("COMMIT TRANSACTION");
db->executeSQL("COMMIT TRANSACTION;");
}
void LedgerConsensus::endConsensus()