Remove unused config param

This commit is contained in:
seelabs
2015-09-02 11:54:24 -04:00
committed by Scott Schurr
parent d8aab5a749
commit d015debe2b
12 changed files with 48 additions and 69 deletions

View File

@@ -190,7 +190,7 @@ CreateOffer::dry_offer (ApplyView& view, Offer const& offer)
if (offer.fully_consumed ())
return true;
auto const amount = accountFunds(view, offer.owner(),
offer.amount().out, fhZERO_IF_FROZEN, ctx_.config);
offer.amount().out, fhZERO_IF_FROZEN);
return (amount <= zero);
}
@@ -239,13 +239,13 @@ CreateOffer::bridged_cross (
throw std::logic_error ("Bridging with XRP and an endpoint.");
OfferStream offers_direct (view, view_cancel,
Book (taker.issue_in (), taker.issue_out ()), when, ctx_.config, j_);
Book (taker.issue_in (), taker.issue_out ()), when, j_);
OfferStream offers_leg1 (view, view_cancel,
Book (taker.issue_in (), xrpIssue ()), when, ctx_.config, j_);
Book (taker.issue_in (), xrpIssue ()), when, j_);
OfferStream offers_leg2 (view, view_cancel,
Book (xrpIssue (), taker.issue_out ()), when, ctx_.config, j_);
Book (xrpIssue (), taker.issue_out ()), when, j_);
TER cross_result = tesSUCCESS;
@@ -290,8 +290,7 @@ CreateOffer::bridged_cross (
j_.debug << " funds: " << accountFunds(view,
offers_direct.tip ().owner (),
offers_direct.tip ().amount ().out,
fhIGNORE_FREEZE,
ctx_.config);
fhIGNORE_FREEZE);
}
cross_result = taker.cross(offers_direct.tip ());
@@ -311,14 +310,12 @@ CreateOffer::bridged_cross (
auto const owner1_funds_before = accountFunds(view,
offers_leg1.tip ().owner (),
offers_leg1.tip ().amount ().out,
fhIGNORE_FREEZE,
ctx_.config);
fhIGNORE_FREEZE);
auto const owner2_funds_before = accountFunds(view,
offers_leg2.tip ().owner (),
offers_leg2.tip ().amount ().out,
fhIGNORE_FREEZE,
ctx_.config);
fhIGNORE_FREEZE);
j_.debug << count << " Bridge:";
j_.debug << " offer1: " << offers_leg1.tip ();
@@ -382,7 +379,7 @@ CreateOffer::direct_cross (
OfferStream offers (
view, view_cancel,
Book (taker.issue_in (), taker.issue_out ()),
when, ctx_.config, j_);
when, j_);
TER cross_result (tesSUCCESS);
int count = 0;
@@ -410,7 +407,7 @@ CreateOffer::direct_cross (
j_.debug << " out: " << offer.amount ().out;
j_.debug << " owner: " << offer.owner ();
j_.debug << " funds: " << accountFunds(view,
offer.owner (), offer.amount ().out, fhIGNORE_FREEZE, ctx_.config);
offer.owner (), offer.amount ().out, fhIGNORE_FREEZE);
}
cross_result = taker.cross (offer);
@@ -485,7 +482,7 @@ CreateOffer::cross (
beast::WrappedSink takerSink (j_, "Taker ");
Taker taker (cross_type_, view, account_, taker_amount,
tx().getFlags(), ctx_.config, beast::Journal (takerSink));
tx().getFlags(), beast::Journal (takerSink));
try
{
@@ -601,7 +598,7 @@ CreateOffer::applyGuts (ApplyView& view, ApplyView& view_cancel)
result = tecFROZEN;
}
else if (accountFunds(view, account_, saTakerGets,
fhZERO_IF_FROZEN, ctx_.config) <= zero)
fhZERO_IF_FROZEN) <= zero)
{
if (j_.debug) j_.debug <<
"delay: Offers must be at least partially funded.";

View File

@@ -25,14 +25,13 @@ namespace ripple {
OfferStream::OfferStream (ApplyView& view, ApplyView& cancelView,
BookRef book, Clock::time_point when,
Config const& config, beast::Journal journal)
beast::Journal journal)
: j_ (journal)
, view_ (view)
, cancelView_ (cancelView)
, book_ (book)
, expire_ (when)
, tip_ (view, book_)
, config_ (config)
{
}
@@ -126,8 +125,7 @@ OfferStream::step ()
// Calculate owner funds
auto const owner_funds = accountFunds(view_,
offer_.owner(), amount.out, fhZERO_IF_FROZEN,
config_);
offer_.owner(), amount.out, fhZERO_IF_FROZEN);
// Check for unfunded offer
if (owner_funds <= zero)
@@ -136,8 +134,7 @@ OfferStream::step ()
// we haven't modified the balance and therefore the
// offer is "found unfunded" versus "became unfunded"
auto const original_funds = accountFunds(cancelView_,
offer_.owner(), amount.out, fhZERO_IF_FROZEN,
config_);
offer_.owner(), amount.out, fhZERO_IF_FROZEN);
if (original_funds == owner_funds)
{

View File

@@ -56,7 +56,6 @@ private:
Clock::time_point const expire_;
BookTip tip_;
Offer offer_;
Config const& config_;
void
erase (ApplyView& view);
@@ -64,7 +63,6 @@ private:
public:
OfferStream (ApplyView& view, ApplyView& cancelView,
BookRef book, Clock::time_point when,
Config const& config,
beast::Journal journal);
/** Returns the offer at the tip of the order book.

View File

@@ -517,13 +517,12 @@ BasicTaker::do_cross (
Taker::Taker (CrossType cross_type, ApplyView& view,
AccountID const& account, Amounts const& offer,
std::uint32_t flags, Config const& config,
std::uint32_t flags,
beast::Journal journal)
: BasicTaker (cross_type, account, offer, Quality(offer), flags,
calculateRate(view, offer.in.getIssuer(), account),
calculateRate(view, offer.out.getIssuer(), account), journal)
, view_ (view)
, config_ (config)
, xrp_flow_ (0)
, direct_crossings_ (0)
, bridge_crossings_ (0)
@@ -574,12 +573,10 @@ Taker::consume_offer (Offer const& offer, Amounts const& order)
offer.consume (view_, order);
}
// VFALCO This function should take a config parameter
STAmount
Taker::get_funds (AccountID const& account, STAmount const& amount) const
{
return accountFunds(view_, account, amount, fhZERO_IF_FROZEN,
config_);
return accountFunds(view_, account, amount, fhZERO_IF_FROZEN);
}
TER Taker::transferXRP (

View File

@@ -246,7 +246,7 @@ public:
Taker (CrossType cross_type, ApplyView& view,
AccountID const& account, Amounts const& offer,
std::uint32_t flags, Config const& config,
std::uint32_t flags,
beast::Journal journal);
~Taker () = default;
@@ -314,8 +314,6 @@ private:
// The underlying ledger entry we are dealing with
ApplyView& view_;
Config const& config_;
// The amount of XRP that flowed if we were autobridging
STAmount xrp_flow_;