rippled
Public Member Functions | Public Attributes | List of all members
ripple::StrandContext Struct Reference

Context needed to build Strand Steps and for error checking. More...

Collaboration diagram for ripple::StrandContext:
Collaboration graph
[legend]

Public Member Functions

 StrandContext (ReadView const &view_, std::vector< std::unique_ptr< Step >> const &strand_, AccountID const &strandSrc_, AccountID const &strandDst_, Issue const &strandDeliver_, std::optional< Quality > const &limitQuality_, bool isLast_, bool ownerPaysTransferFee_, OfferCrossing offerCrossing_, bool isDefaultPath_, std::array< boost::container::flat_set< Issue >, 2 > &seenDirectIssues_, boost::container::flat_set< Issue > &seenBookOuts_, AMMContext &ammContext_, beast::Journal j_)
 StrandContext constructor. More...
 

Public Attributes

ReadView const & view
 Current ReadView. More...
 
const AccountID strandSrc
 Strand source account. More...
 
const AccountID strandDst
 Strand destination account. More...
 
const Issue strandDeliver
 Issue strand delivers. More...
 
const std::optional< Quality > limitQuality
 Worst accepted quality. More...
 
const bool isFirst
 true if Step is first in Strand More...
 
const bool isLast = false
 true if Step is last in Strand More...
 
const bool ownerPaysTransferFee
 true if owner, not sender, pays fee More...
 
const OfferCrossing offerCrossing
 Yes/Sell if offer crossing, not payment. More...
 
const bool isDefaultPath
 true if Strand is default path More...
 
const size_t strandSize
 Length of Strand. More...
 
Step const *const prevStep = nullptr
 The previous step in the strand. More...
 
std::array< boost::container::flat_set< Issue >, 2 > & seenDirectIssues
 A strand may not include the same account node more than once in the same currency. More...
 
boost::container::flat_set< Issue > & seenBookOuts
 A strand may not include an offer that output the same issue more than once. More...
 
AMMContextammContext
 
const beast::Journal j
 

Detailed Description

Context needed to build Strand Steps and for error checking.

Definition at line 525 of file Steps.h.

Constructor & Destructor Documentation

◆ StrandContext()

ripple::StrandContext::StrandContext ( ReadView const &  view_,
std::vector< std::unique_ptr< Step >> const &  strand_,
AccountID const &  strandSrc_,
AccountID const &  strandDst_,
Issue const &  strandDeliver_,
std::optional< Quality > const &  limitQuality_,
bool  isLast_,
bool  ownerPaysTransferFee_,
OfferCrossing  offerCrossing_,
bool  isDefaultPath_,
std::array< boost::container::flat_set< Issue >, 2 > &  seenDirectIssues_,
boost::container::flat_set< Issue > &  seenBookOuts_,
AMMContext ammContext_,
beast::Journal  j_ 
)

StrandContext constructor.

Journal for logging

Parameters
seenDirectIssues_For detecting currency loops
seenBookOuts_For detecting book loops

Definition at line 580 of file PaySteps.cpp.

Member Data Documentation

◆ view

ReadView const& ripple::StrandContext::view

Current ReadView.

Definition at line 527 of file Steps.h.

◆ strandSrc

const AccountID ripple::StrandContext::strandSrc

Strand source account.

Definition at line 528 of file Steps.h.

◆ strandDst

const AccountID ripple::StrandContext::strandDst

Strand destination account.

Definition at line 529 of file Steps.h.

◆ strandDeliver

const Issue ripple::StrandContext::strandDeliver

Issue strand delivers.

Definition at line 530 of file Steps.h.

◆ limitQuality

const std::optional<Quality> ripple::StrandContext::limitQuality

Worst accepted quality.

Definition at line 531 of file Steps.h.

◆ isFirst

const bool ripple::StrandContext::isFirst

true if Step is first in Strand

Definition at line 532 of file Steps.h.

◆ isLast

const bool ripple::StrandContext::isLast = false

true if Step is last in Strand

Definition at line 533 of file Steps.h.

◆ ownerPaysTransferFee

const bool ripple::StrandContext::ownerPaysTransferFee

true if owner, not sender, pays fee

Definition at line 534 of file Steps.h.

◆ offerCrossing

const OfferCrossing ripple::StrandContext::offerCrossing

Yes/Sell if offer crossing, not payment.

Definition at line 536 of file Steps.h.

◆ isDefaultPath

const bool ripple::StrandContext::isDefaultPath

true if Strand is default path

Definition at line 537 of file Steps.h.

◆ strandSize

const size_t ripple::StrandContext::strandSize

Length of Strand.

Definition at line 538 of file Steps.h.

◆ prevStep

Step const* const ripple::StrandContext::prevStep = nullptr

The previous step in the strand.

Needed to check the no ripple constraint

Definition at line 542 of file Steps.h.

◆ seenDirectIssues

std::array<boost::container::flat_set<Issue>, 2>& ripple::StrandContext::seenDirectIssues

A strand may not include the same account node more than once in the same currency.

In a direct step, an account will show up at most twice: once as a src and once as a dst (hence the two element array). The strandSrc and strandDst will only show up once each.

Definition at line 548 of file Steps.h.

◆ seenBookOuts

boost::container::flat_set<Issue>& ripple::StrandContext::seenBookOuts

A strand may not include an offer that output the same issue more than once.

Definition at line 552 of file Steps.h.

◆ ammContext

AMMContext& ripple::StrandContext::ammContext

Definition at line 553 of file Steps.h.

◆ j

const beast::Journal ripple::StrandContext::j

Definition at line 554 of file Steps.h.