Pass by reference in processTransaction

This commit is contained in:
Miguel Portilla
2015-07-09 13:24:29 -04:00
committed by Vinnie Falco
parent d8d51e8103
commit de6f678de7
6 changed files with 14 additions and 23 deletions

View File

@@ -91,25 +91,17 @@ STTx::pointer TransactionMaster::fetch (std::shared_ptr<SHAMapItem> const& item,
return txn;
}
bool TransactionMaster::canonicalize (Transaction::pointer* pTransaction)
void
TransactionMaster::canonicalize(Transaction::pointer* pTransaction)
{
Transaction::pointer txn (*pTransaction);
uint256 tid = txn->getID ();
if (!tid)
return false;
// VFALCO NOTE canonicalize can change the value of txn!
if (mCache.canonicalize (tid, txn))
uint256 const tid = (*pTransaction)->getID();
if (tid != zero)
{
Transaction::pointer txn(*pTransaction);
// VFALCO NOTE canonicalize can change the value of txn!
mCache.canonicalize(tid, txn);
*pTransaction = txn;
return true;
}
// VFALCO NOTE I am unsure if this is necessary but better safe than sorry.
*pTransaction = txn;
return false;
}
void TransactionMaster::sweep (void)