mirror of
https://github.com/XRPLF/rippled.git
synced 2025-12-06 17:27:55 +00:00
Rework RPCServer to go through NetworkOPs.
This commit is contained in:
32
src/RippleState.cpp
Normal file
32
src/RippleState.cpp
Normal file
@@ -0,0 +1,32 @@
|
||||
#include "RippleState.h"
|
||||
|
||||
RippleState::RippleState(SerializedLedgerEntry::pointer ledgerEntry) :
|
||||
mLedgerEntry(ledgerEntry),
|
||||
mValid(false),
|
||||
mViewLowest(true)
|
||||
{
|
||||
if (!mLedgerEntry || mLedgerEntry->getType() != ltRIPPLE_STATE) return;
|
||||
|
||||
mLowID = mLedgerEntry->getIValueFieldAccount(sfLowID);
|
||||
mHighID = mLedgerEntry->getIValueFieldAccount(sfHighID);
|
||||
|
||||
mLowLimit = mLedgerEntry->getIValueFieldAmount(sfLowLimit);
|
||||
mHighLimit = mLedgerEntry->getIValueFieldAmount(sfHighLimit);
|
||||
|
||||
// YYY Should never fail.
|
||||
if (mLowID.isValid() && mHighID.isValid())
|
||||
mValid = true;
|
||||
}
|
||||
|
||||
void RippleState::setViewAccount(const NewcoinAddress& naView)
|
||||
{
|
||||
bool bViewLowestNew = mLowID.getAccountID() == naView.getAccountID();
|
||||
|
||||
if (bViewLowestNew != mViewLowest)
|
||||
{
|
||||
mViewLowest = bViewLowestNew;
|
||||
mBalance.changeSign();
|
||||
}
|
||||
}
|
||||
|
||||
// vim:ts=4
|
||||
Reference in New Issue
Block a user