diff --git a/src/ripple/resource/api/Fees.h b/src/ripple/resource/api/Fees.h index f9b957ea4..1c34f6557 100644 --- a/src/ripple/resource/api/Fees.h +++ b/src/ripple/resource/api/Fees.h @@ -40,6 +40,7 @@ extern Charge const feeLightRPC; // A normal RPC command extern Charge const feeLowBurdenRPC; // A slightly burdensome RPC load extern Charge const feeMediumBurdenRPC; // A somewhat burdensome RPC load extern Charge const feeHighBurdenRPC; // A very burdensome RPC load +extern Charge const feePathFindUpdate; // An update to an existing PF request // Good things extern Charge const feeNewTrustedNote; // A new transaction/validation/proposal we trust diff --git a/src/ripple/resource/impl/Fees.cpp b/src/ripple/resource/impl/Fees.cpp index a8891f916..998c8b2a2 100644 --- a/src/ripple/resource/impl/Fees.cpp +++ b/src/ripple/resource/impl/Fees.cpp @@ -34,6 +34,7 @@ Charge const feeLightRPC ( 5, "light RPC" ); // DAVID: C Charge const feeLowBurdenRPC ( 20, "low RPC" ); Charge const feeMediumBurdenRPC ( 40, "medium RPC" ); Charge const feeHighBurdenRPC ( 300, "heavy RPC" ); +Charge const feePathFindUpdate ( 100, "path update" ); Charge const feeNewTrustedNote ( 10, "trusted note" ); Charge const feeNewValidTx ( 10, "valid tx" ); diff --git a/src/ripple_app/paths/PathRequests.cpp b/src/ripple_app/paths/PathRequests.cpp index ca9543601..c6e36e817 100644 --- a/src/ripple_app/paths/PathRequests.cpp +++ b/src/ripple_app/paths/PathRequests.cpp @@ -86,11 +86,15 @@ void PathRequests::updateAll (Ledger::ref inLedger, CancelCallback shouldCancel) InfoSub::pointer ipSub = pRequest->getSubscriber (); if (ipSub) { - Json::Value update = pRequest->doUpdate (cache, false); - update["type"] = "path_find"; - ipSub->send (update, false); - remove = false; - ++processed; + ipSub->getConsumer ().charge (Resource::feePathFindUpdate); + if (!ipSub->getConsumer ().warn ()) + { + Json::Value update = pRequest->doUpdate (cache, false); + update["type"] = "path_find"; + ipSub->send (update, false); + remove = false; + ++processed; + } } } }