mirror of
https://github.com/Xahau/xahaud.git
synced 2025-12-06 17:27:52 +00:00
Charge for pathfinding updates.
This commit is contained in:
@@ -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
|
||||
|
||||
@@ -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" );
|
||||
|
||||
@@ -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;
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user