mirror of
https://github.com/XRPLF/rippled.git
synced 2025-12-06 17:27:55 +00:00
Don't charge for transactions twice. Have the "old" getTransaction handle metadata sanely.
Fix calcRawMeta to fit the new model where an LES holds a reference to its ledger Don't put metadata in open ledger txn sets to avoid breaking the proposal mechanism.
This commit is contained in:
@@ -232,14 +232,30 @@ bool Ledger::addTransaction(const uint256& txID, const Serializer& txn, const Se
|
||||
|
||||
Transaction::pointer Ledger::getTransaction(const uint256& transID) const
|
||||
{
|
||||
SHAMapItem::pointer item = mTransactionMap->peekItem(transID);
|
||||
SHAMapTreeNode::TNType type;
|
||||
SHAMapItem::pointer item = mTransactionMap->peekItem(transID, type);
|
||||
if (!item) return Transaction::pointer();
|
||||
|
||||
Transaction::pointer txn = theApp->getMasterTransaction().fetch(transID, false);
|
||||
if (txn)
|
||||
return txn;
|
||||
|
||||
txn = Transaction::sharedTransaction(item->getData(), true);
|
||||
if (type == SHAMapTreeNode::tnTRANSACTION_NM)
|
||||
txn = Transaction::sharedTransaction(item->getData(), true);
|
||||
else if (type == SHAMapTreeNode::tnTRANSACTION_MD)
|
||||
{
|
||||
std::vector<unsigned char> txnData;
|
||||
int txnLength;
|
||||
if (!item->peekSerializer().getVL(txnData, 0, txnLength))
|
||||
return Transaction::pointer();
|
||||
txn = Transaction::sharedTransaction(txnData, false);
|
||||
}
|
||||
else
|
||||
{
|
||||
assert(false);
|
||||
return Transaction::pointer();
|
||||
}
|
||||
|
||||
if (txn->getStatus() == NEW)
|
||||
txn->setStatus(mClosed ? COMMITTED : INCLUDED, mLedgerSeq);
|
||||
|
||||
|
||||
Reference in New Issue
Block a user