mirror of
https://github.com/Xahau/xahaud.git
synced 2025-12-06 17:27:52 +00:00
Improve error reporting for account not found.
This commit is contained in:
@@ -186,18 +186,22 @@ AccountState::pointer Ledger::getAccountState(const RippleAddress& accountID)
|
||||
#ifdef DEBUG
|
||||
// std::cerr << "Ledger:getAccountState(" << accountID.humanAccountID() << ")" << std::endl;
|
||||
#endif
|
||||
|
||||
SHAMapItem::pointer item = mAccountStateMap->peekItem(Ledger::getAccountRootIndex(accountID));
|
||||
if (!item)
|
||||
{
|
||||
#ifdef DEBUG
|
||||
// std::cerr << " notfound" << std::endl;
|
||||
#endif
|
||||
cLog(lsDEBUG) << boost::str(boost::format("Ledger:getAccountState: not found: %s: %s")
|
||||
% accountID.humanAccountID()
|
||||
% Ledger::getAccountRootIndex(accountID).GetHex());
|
||||
|
||||
return AccountState::pointer();
|
||||
}
|
||||
|
||||
SerializedLedgerEntry::pointer sle =
|
||||
boost::make_shared<SerializedLedgerEntry>(item->peekSerializer(), item->getTag());
|
||||
if (sle->getType() != ltACCOUNT_ROOT)
|
||||
return AccountState::pointer();
|
||||
|
||||
return boost::make_shared<AccountState>(sle,accountID);
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user