Fix 'tx' output format. Begin supporting a binary output format.

This adds support for binary in 'tx' and 'account_tx' commands.
https://ripple.com/wiki/FormatChange
This commit is contained in:
JoelKatz
2013-02-25 12:51:06 -08:00
parent fc221a8d7c
commit 923446fb78
10 changed files with 167 additions and 37 deletions

View File

@@ -377,6 +377,22 @@ bool Ledger::getTransactionMeta(const uint256& txID, TransactionMetaSet::pointer
return true;
}
bool Ledger::getMetaHex(const uint256& transID, std::string& hex)
{
SHAMapTreeNode::TNType type;
SHAMapItem::pointer item = mTransactionMap->peekItem(transID, type);
if (!item)
return false;
if (type != SHAMapTreeNode::tnTRANSACTION_MD)
return false;
SerializerIterator it(item->peekSerializer());
it.getVL(); // skip transaction
hex = strHex(it.getVL());
return true;
}
uint256 Ledger::getHash()
{
if (!mValidHash)