diff --git a/src/AccountState.cpp b/src/AccountState.cpp index 88307dbb37..6c0e798e46 100644 --- a/src/AccountState.cpp +++ b/src/AccountState.cpp @@ -4,6 +4,8 @@ #include #include +#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 diff --git a/src/AccountState.h b/src/AccountState.h index c2c3190c2b..be8677b5d2 100644 --- a/src/AccountState.h +++ b/src/AccountState.h @@ -38,6 +38,7 @@ public: std::vector getRaw() const; void addJson(Json::Value& value); + void dump(); }; #endif