mirror of
https://github.com/XRPLF/rippled.git
synced 2025-12-06 17:27:55 +00:00
Cleanups.
This commit is contained in:
@@ -152,6 +152,17 @@ TransactionMetaNodeEntry* TransactionMetaNode::findEntry(int nodeType)
|
||||
return NULL;
|
||||
}
|
||||
|
||||
TMNEBalance* TransactionMetaNode::findBalance()
|
||||
{
|
||||
for (boost::ptr_vector<TransactionMetaNodeEntry>::iterator it = mEntries.begin(), end = mEntries.end();
|
||||
it != end; ++it)
|
||||
if (it->getType() == TransactionMetaNodeEntry::TMNChangedBalance)
|
||||
return dynamic_cast<TMNEBalance *>(&*it);
|
||||
TMNEBalance* node = new TMNEBalance();
|
||||
mEntries.push_back(node);
|
||||
return node;
|
||||
}
|
||||
|
||||
void TransactionMetaNode::addNode(TransactionMetaNodeEntry* node)
|
||||
{
|
||||
mEntries.push_back(node);
|
||||
@@ -261,7 +272,7 @@ void TransactionMetaSet::threadNode(const uint256& node, const uint256& prevTx,
|
||||
modifyNode(node).thread(prevTx, prevLgr);
|
||||
}
|
||||
|
||||
bool TransactionMetaSet::deleteUnfunded(const uint256& nodeID,
|
||||
void TransactionMetaSet::deleteUnfunded(const uint256& nodeID,
|
||||
const STAmount& firstBalance, const STAmount &secondBalance)
|
||||
{
|
||||
TransactionMetaNode& node = modifyNode(nodeID);
|
||||
@@ -270,5 +281,4 @@ bool TransactionMetaSet::deleteUnfunded(const uint256& nodeID,
|
||||
entry->setBalances(firstBalance, secondBalance);
|
||||
else
|
||||
node.addNode(new TMNEUnfunded(firstBalance, secondBalance));
|
||||
return true;
|
||||
}
|
||||
|
||||
@@ -114,6 +114,7 @@ public:
|
||||
const boost::ptr_vector<TransactionMetaNodeEntry>& peekEntries() const { return mEntries; }
|
||||
|
||||
TransactionMetaNodeEntry* findEntry(int nodeType);
|
||||
TMNEBalance* findBalance();
|
||||
void addNode(TransactionMetaNodeEntry*);
|
||||
|
||||
bool operator<(const TransactionMetaNode& n) const { return mNode < n.mNode; }
|
||||
@@ -126,6 +127,11 @@ public:
|
||||
TransactionMetaNode(const uint256&node, SerializerIterator&);
|
||||
void addRaw(Serializer&);
|
||||
Json::Value getJson(int) const;
|
||||
|
||||
void threadNode(const uint256& previousTransaction, uint32 previousLedger);
|
||||
void deleteUnfunded(const STAmount& firstBalance, const STAmount& secondBalance);
|
||||
void adjustBalance(unsigned flags, const STAmount &amount, bool signedBy);
|
||||
void adjustBalances(unsigned flags, const STAmount &firstAmt, const STAmount &secondAmt);
|
||||
};
|
||||
|
||||
|
||||
@@ -148,16 +154,11 @@ public:
|
||||
void swap(TransactionMetaSet&);
|
||||
|
||||
bool isNodeAffected(const uint256&) const;
|
||||
TransactionMetaNode& getAffectedNode(const uint256&);
|
||||
const TransactionMetaNode& peekAffectedNode(const uint256&) const;
|
||||
|
||||
Json::Value getJson(int) const;
|
||||
void addRaw(Serializer&);
|
||||
|
||||
void threadNode(const uint256& node, const uint256& previousTransaction, uint32 previousLedger);
|
||||
bool signedBy(const uint256& node, const STAmount& fee);
|
||||
bool deleteUnfunded(const uint256& node, const STAmount& firstBalance, const STAmount& secondBalance);
|
||||
bool adjustBalance(const uint256& node, unsigned flags, const STAmount &amount);
|
||||
bool adjustBalances(const uint256& node, unsigned flags, const STAmount &firstAmt, const STAmount &secondAmt);
|
||||
};
|
||||
|
||||
#endif
|
||||
|
||||
Reference in New Issue
Block a user