mirror of
https://github.com/Xahau/xahaud.git
synced 2025-12-06 17:27:52 +00:00
Remove mLedger from PathState. It's not used and it's scary (because an LES could amend it).
This commit is contained in:
@@ -88,7 +88,7 @@ bool Pathfinder::bDefaultPath(const STPath& spPath)
|
||||
return false; // Didn't generate a default path. So can't match.
|
||||
}
|
||||
|
||||
PathState::pointer pspCurrent = boost::make_shared<PathState>(mDstAmount, mSrcAmount, mLedger);
|
||||
PathState::pointer pspCurrent = boost::make_shared<PathState>(mDstAmount, mSrcAmount);
|
||||
|
||||
if (pspCurrent)
|
||||
{
|
||||
@@ -163,7 +163,7 @@ Pathfinder::Pathfinder(Ledger::ref ledger,
|
||||
|
||||
// Construct the default path for later comparison.
|
||||
|
||||
PathState::pointer psDefault = boost::make_shared<PathState>(mDstAmount, mSrcAmount, mLedger);
|
||||
PathState::pointer psDefault = boost::make_shared<PathState>(mDstAmount, mSrcAmount);
|
||||
|
||||
if (psDefault)
|
||||
{
|
||||
|
||||
@@ -2676,7 +2676,7 @@ TER RippleCalc::rippleCalc(
|
||||
// Build a default path. Use saDstAmountReq and saMaxAmountReq to imply nodes.
|
||||
// XXX Might also make a XRP bridge by default.
|
||||
|
||||
PathState::pointer pspDirect = boost::make_shared<PathState>(saDstAmountReq, saMaxAmountReq, lesActive.getLedgerRef());
|
||||
PathState::pointer pspDirect = boost::make_shared<PathState>(saDstAmountReq, saMaxAmountReq);
|
||||
|
||||
if (!pspDirect)
|
||||
return temUNKNOWN;
|
||||
@@ -2706,10 +2706,10 @@ cLog(lsDEBUG) << boost::str(boost::format("rippleCalc: Build direct: status: %s"
|
||||
|
||||
cLog(lsTRACE) << "rippleCalc: Paths in set: " << spsPaths.size();
|
||||
|
||||
int iIndex = 0;
|
||||
int iIndex = 0;
|
||||
BOOST_FOREACH(const STPath& spPath, spsPaths)
|
||||
{
|
||||
PathState::pointer pspExpanded = boost::make_shared<PathState>(saDstAmountReq, saMaxAmountReq, lesActive.getLedgerRef());
|
||||
PathState::pointer pspExpanded = boost::make_shared<PathState>(saDstAmountReq, saMaxAmountReq);
|
||||
|
||||
if (!pspExpanded)
|
||||
return temUNKNOWN;
|
||||
|
||||
@@ -71,8 +71,6 @@ extern std::size_t hash_value(const aciSource& asValue);
|
||||
class PathState
|
||||
{
|
||||
protected:
|
||||
Ledger::pointer mLedger;
|
||||
|
||||
TER pushNode(const int iType, const uint160& uAccountID, const uint160& uCurrencyID, const uint160& uIssuerID);
|
||||
TER pushImply(const uint160& uAccountID, const uint160& uCurrencyID, const uint160& uIssuerID);
|
||||
|
||||
@@ -116,12 +114,11 @@ public:
|
||||
|
||||
PathState(
|
||||
const STAmount& saSend,
|
||||
const STAmount& saSendMax,
|
||||
Ledger::pointer lrLedger = Ledger::pointer()
|
||||
) : mLedger(lrLedger), saInReq(saSendMax), saOutReq(saSend) { ; }
|
||||
const STAmount& saSendMax
|
||||
) : saInReq(saSendMax), saOutReq(saSend) { ; }
|
||||
|
||||
PathState(const PathState& psSrc, bool bUnused)
|
||||
: mLedger(psSrc.mLedger), saInReq(psSrc.saInReq), saOutReq(psSrc.saOutReq) { ; }
|
||||
: saInReq(psSrc.saInReq), saOutReq(psSrc.saOutReq) { ; }
|
||||
|
||||
void setExpanded(
|
||||
const LedgerEntrySet& lesSource,
|
||||
|
||||
Reference in New Issue
Block a user