add account_offers and refactor

This commit is contained in:
jed
2012-12-04 12:12:11 -08:00
parent 4ef15c5536
commit 50953ff6d5
19 changed files with 257 additions and 138 deletions

View File

@@ -1,12 +1,19 @@
#include "RippleState.h"
RippleState::RippleState(SerializedLedgerEntry::pointer ledgerEntry) :
mLedgerEntry(ledgerEntry),
AccountItem::pointer RippleState::makeItem(uint160& accountID, SerializedLedgerEntry::pointer ledgerEntry)
{
if (!mLedgerEntry || mLedgerEntry->getType() != ltRIPPLE_STATE) return(AccountItem::pointer());
RippleState* rs=new RippleState(ledgerEntry);
rs->setViewAccount(accountID);
return(AccountItem::pointer(rs));
}
RippleState::RippleState(SerializedLedgerEntry::pointer ledgerEntry) : AccountItem(ledgerEntry),
mValid(false),
mViewLowest(true)
{
if (!mLedgerEntry || mLedgerEntry->getType() != ltRIPPLE_STATE) return;
mLowLimit = mLedgerEntry->getFieldAmount(sfLowLimit);
mHighLimit = mLedgerEntry->getFieldAmount(sfHighLimit);