Cleanups.

This commit is contained in:
JoelKatz
2013-01-29 14:28:05 -08:00
parent 1a6eac274f
commit 6b4141f583
5 changed files with 33 additions and 27 deletions

View File

@@ -66,18 +66,23 @@ SerializedTransaction::pointer TransactionMaster::fetch(SHAMapItem::ref item, SH
return txn;
}
static void saveTransactionHelper(Transaction::pointer txn, LoadEvent::pointer)
static void saveHelper(Transaction::pointer txn, LoadEvent::pointer l)
{
Transaction::saveTransaction(txn);
txn->save();
l.reset();
}
bool TransactionMaster::canonicalize(Transaction::pointer& txn, bool may_be_new)
{
uint256 tid = txn->getID();
if (!tid) return false;
if (mCache.canonicalize(tid, txn)) return true;
if (!tid)
return false;
if (mCache.canonicalize(tid, txn))
return true;
if (may_be_new)
theApp->getAuxService().post(boost::bind(&saveTransactionHelper, txn,
theApp->getAuxService().post(boost::bind(saveHelper, txn,
theApp->getJobQueue().getLoadEvent(jtDISK)));
return false;
}