Merge branch 'master' of github.com:jedmccaleb/NewCoin into notdone

This commit is contained in:
jed
2012-11-29 09:23:08 -08:00
16 changed files with 93 additions and 32 deletions

View File

@@ -146,12 +146,13 @@ bool Transaction::save()
default: status = TXN_SQL_UNKNOWN;
}
std::string exists = boost::str(boost::format("SELECT Status FROM Transactions WHERE TransID = '%s';")
% mTransaction->getTransactionID().GetHex());
static boost::format selStat("SELECT Status FROM Transactions WHERE TransID = '%s';");
std::string exists = boost::str(selStat % mTransaction->getTransactionID().GetHex());
Database *db = theApp->getTxnDB()->getDB();
ScopedLock dbLock = theApp->getTxnDB()->getDBLock();
if (SQL_EXISTS(db, exists)) return false;
ScopedLock dbLock(theApp->getTxnDB()->getDBLock());
if (SQL_EXISTS(db, exists))
return false;
return
db->executeSQL(mTransaction->getSQLInsertHeader() + mTransaction->getSQL(getLedger(), status) + ";");
}