mirror of
https://github.com/XRPLF/rippled.git
synced 2025-12-06 17:27:55 +00:00
Make debug easier.
This commit is contained in:
@@ -4,6 +4,8 @@
|
||||
#include <boost/lexical_cast.hpp>
|
||||
#include <boost/make_shared.hpp>
|
||||
|
||||
#include "../json/writer.h"
|
||||
|
||||
#include "Ledger.h"
|
||||
#include "Serializer.h"
|
||||
|
||||
@@ -19,7 +21,7 @@ AccountState::AccountState(const NewcoinAddress& id) : mAccountID(id), mValid(fa
|
||||
AccountState::AccountState(SerializedLedgerEntry::pointer ledgerEntry) : mLedgerEntry(ledgerEntry), mValid(false)
|
||||
{
|
||||
if (!mLedgerEntry) return;
|
||||
if (mLedgerEntry->getType()!=ltACCOUNT_ROOT) return;
|
||||
if (mLedgerEntry->getType() != ltACCOUNT_ROOT) return;
|
||||
mAccountID = mLedgerEntry->getValueFieldAccount(sfAccount);
|
||||
if (mAccountID.isValid()) mValid = true;
|
||||
}
|
||||
@@ -27,6 +29,14 @@ AccountState::AccountState(SerializedLedgerEntry::pointer ledgerEntry) : mLedger
|
||||
void AccountState::addJson(Json::Value& val)
|
||||
{
|
||||
val = mLedgerEntry->getJson(0);
|
||||
if(!mValid) val["Invalid"]=true;
|
||||
if (!mValid) val["Invalid"] = true;
|
||||
}
|
||||
|
||||
void AccountState::dump()
|
||||
{
|
||||
Json::Value j(Json::objectValue);
|
||||
Json::StyledStreamWriter ssw;
|
||||
ssw.write(std::cerr, j);
|
||||
}
|
||||
|
||||
// vim:ts=4
|
||||
|
||||
@@ -38,6 +38,7 @@ public:
|
||||
|
||||
std::vector<unsigned char> getRaw() const;
|
||||
void addJson(Json::Value& value);
|
||||
void dump();
|
||||
};
|
||||
|
||||
#endif
|
||||
|
||||
Reference in New Issue
Block a user