xrpld
Loading...
Searching...
No Matches
xrpl::ValidLoanBroker Class Reference

Invariants: Loan brokers are internally consistent. More...

#include <LoanBrokerInvariant.h>

Collaboration diagram for xrpl::ValidLoanBroker:

Classes

struct  BrokerInfo

Public Member Functions

void visitEntry (bool, SLE::ConstRef, SLE::ConstRef)
bool finalize (STTx const &, TER const, XRPAmount const, ReadView const &, beast::Journal const &)

Static Private Member Functions

static bool goodZeroDirectory (ReadView const &view, SLE::ConstRef dir, beast::Journal const &j)

Private Attributes

std::map< UInt256, BrokerInfo > brokers_
SLE::const_pointer deletedBroker_ = nullptr
bool multipleBrokerDeletions_ = false
std::vector< SLE::const_pointer > lines_
std::vector< SLE::const_pointer > mpts_

Detailed Description

Invariants: Loan brokers are internally consistent.

  1. If LoanBroker.OwnerCount = 0 the DirectoryNode will have at most one node (the root), which will only hold entries for RippleState or MPToken objects.
  2. Under featureLendingProtocolV1_1, an ltLOAN_BROKER may only be deleted by a ttLOAN_BROKER_DELETE transaction, and only when its pre-state OwnerCount is zero and its pre-state DebtTotal rounds to zero at the vault's AssetsTotal scale, as LoanBrokerDelete::preclaim requires.
  3. At most one ltLOAN_BROKER may be deleted in a single transaction.

Definition at line 29 of file LoanBrokerInvariant.h.

Member Function Documentation

◆ goodZeroDirectory()

bool xrpl::ValidLoanBroker::goodZeroDirectory ( ReadView const & view,
SLE::ConstRef dir,
beast::Journal const & j )
staticprivate

Definition at line 74 of file LoanBrokerInvariant.cpp.

◆ visitEntry()

void xrpl::ValidLoanBroker::visitEntry ( bool isDelete,
SLE::ConstRef before,
SLE::ConstRef after )

Definition at line 28 of file LoanBrokerInvariant.cpp.

◆ finalize()

bool xrpl::ValidLoanBroker::finalize ( STTx const & tx,
TER const ,
XRPAmount const ,
ReadView const & view,
beast::Journal const & j )

Definition at line 112 of file LoanBrokerInvariant.cpp.

Member Data Documentation

◆ brokers_

std::map<UInt256, BrokerInfo> xrpl::ValidLoanBroker::brokers_
private

Definition at line 43 of file LoanBrokerInvariant.h.

◆ deletedBroker_

SLE::const_pointer xrpl::ValidLoanBroker::deletedBroker_ = nullptr
private

Definition at line 49 of file LoanBrokerInvariant.h.

◆ multipleBrokerDeletions_

bool xrpl::ValidLoanBroker::multipleBrokerDeletions_ = false
private

Definition at line 52 of file LoanBrokerInvariant.h.

◆ lines_

std::vector<SLE::const_pointer> xrpl::ValidLoanBroker::lines_
private

Definition at line 55 of file LoanBrokerInvariant.h.

◆ mpts_

std::vector<SLE::const_pointer> xrpl::ValidLoanBroker::mpts_
private

Definition at line 58 of file LoanBrokerInvariant.h.