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_, bool offerCrossing_, bool isDefaultPath_, std::array< boost::container::flat_set< Issue >, 2 > &seenDirectIssues_, boost::container::flat_set< Issue > &seenBookOuts_, 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 bool offerCrossing
 true 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...
 
const beast::Journal j
 

Detailed Description

Context needed to build Strand Steps and for error checking.

Definition at line 497 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_,
bool  offerCrossing_,
bool  isDefaultPath_,
std::array< boost::container::flat_set< Issue >, 2 > &  seenDirectIssues_,
boost::container::flat_set< Issue > &  seenBookOuts_,
beast::Journal  j_ 
)

StrandContext constructor.

Journal for logging

Parameters
seenDirectIssues_For detecting currency loops
seenBookOuts_For detecting book loops

Definition at line 575 of file PaySteps.cpp.

Member Data Documentation

◆ view

ReadView const& ripple::StrandContext::view

Current ReadView.

Definition at line 499 of file Steps.h.

◆ strandSrc

const AccountID ripple::StrandContext::strandSrc

Strand source account.

Definition at line 500 of file Steps.h.

◆ strandDst

const AccountID ripple::StrandContext::strandDst

Strand destination account.

Definition at line 501 of file Steps.h.

◆ strandDeliver

const Issue ripple::StrandContext::strandDeliver

Issue strand delivers.

Definition at line 502 of file Steps.h.

◆ limitQuality

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

Worst accepted quality.

Definition at line 503 of file Steps.h.

◆ isFirst

const bool ripple::StrandContext::isFirst

true if Step is first in Strand

Definition at line 504 of file Steps.h.

◆ isLast

const bool ripple::StrandContext::isLast = false

true if Step is last in Strand

Definition at line 505 of file Steps.h.

◆ ownerPaysTransferFee

const bool ripple::StrandContext::ownerPaysTransferFee

true if owner, not sender, pays fee

Definition at line 506 of file Steps.h.

◆ offerCrossing

const bool ripple::StrandContext::offerCrossing

true if offer crossing, not payment

Definition at line 507 of file Steps.h.

◆ isDefaultPath

const bool ripple::StrandContext::isDefaultPath

true if Strand is default path

Definition at line 508 of file Steps.h.

◆ strandSize

const size_t ripple::StrandContext::strandSize

Length of Strand.

Definition at line 509 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 513 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 519 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 523 of file Steps.h.

◆ j

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

Definition at line 524 of file Steps.h.