Santize locally submited transactions.

This commit is contained in:
Arthur Britto
2012-07-18 14:48:50 -07:00
parent f8882b32bf
commit af92bb5347
3 changed files with 39 additions and 17 deletions

View File

@@ -44,6 +44,24 @@ uint32 NetworkOPs::getCurrentLedgerID()
return mLedgerMaster->getCurrentLedger()->getLedgerSeq();
}
// Sterilize transaction through serialization.
void NetworkOPs::submitTransaction(Transaction::pointer tpTrans)
{
Serializer s;
tpTrans->getSTransaction()->add(s);
std::vector<unsigned char> vucTransaction = s.getData();
SerializerIterator sit(s);
Transaction::pointer tpTransNew = Transaction::sharedTransaction(s.getData(), true);
assert(tpTransNew);
(void) NetworkOPs::processTransaction(tpTransNew);
}
Transaction::pointer NetworkOPs::processTransaction(Transaction::pointer trans, uint32 tgtLedger, Peer* source)
{
Transaction::pointer dbtx = theApp->getMasterTransaction().fetch(trans->getID(), true);