Set up for ledger diffs to populate the metadata.

Special case for unfunded offers -- need to know how much was taken before deletion
This commit is contained in:
JoelKatz
2012-07-28 14:49:34 -07:00
parent 74d0fe000c
commit 1167ba2cc0
6 changed files with 26 additions and 6 deletions

View File

@@ -71,8 +71,12 @@ public:
class TMNEUnfunded : public TransactionMetaNodeEntry
{ // node was deleted because it was unfunded
protected:
STAmount firstAmount, secondAmount; // Amounts left when declared unfunded
public:
TMNEUnfunded() : TransactionMetaNodeEntry(TMNDeleteUnfunded) { ; }
TMNEUnfunded(const STAmount& f, const STAmount& s) :
TransactionMetaNodeEntry(TMNDeleteUnfunded), firstAmount(f), secondAmount(s) { ; }
virtual void addRaw(Serializer&) const;
virtual Json::Value getJson(int) const;
virtual int compare(const TransactionMetaNodeEntry&) const;
@@ -132,7 +136,7 @@ public:
void threadNode(const uint256& node, const uint256& previousTransaction, uint32 previousLedger);
bool signedBy(const uint256& node, const STAmount& fee);
bool deleteUnfunded(const uint256& node);
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);
};