Bitcoin ABC 0.34.5
P2P Digital Currency
Loading...
Searching...
No Matches
Classes | Functions
invrequest.h File Reference
#include <net.h>
#include <net_permissions.h>
#include <chrono>
#include <cstdint>
#include <functional>
#include <vector>
Include dependency graph for invrequest.h:
This graph shows which files directly or indirectly include this file:

Go to the source code of this file.

Classes

class  InvRequestTrackerImplInterface
 Data structure to keep track of, and schedule, inventory downloads from peers. More...
 
class  InvRequestTracker< InvId >
 
struct  DataRequestParameters
 

Functions

template<class InvId >
bool TooManyAnnouncements (const InvRequestTracker< InvId > &requestTracker, NodeId nodeid, const DataRequestParameters &requestParams, bool bypass_limits)
 Whether the peer already has too many announcements tracked to accept a new one.
 
template<class InvId >
std::chrono::microseconds ComputeRequestTime (const InvRequestTracker< InvId > &requestTracker, NodeId nodeid, const DataRequestParameters &requestParams, std::chrono::microseconds current_time, bool preferred, bool bypass_limits)
 Compute the request time for this announcement, current time plus delays for:
 

Function Documentation

◆ ComputeRequestTime()

template<class InvId >
std::chrono::microseconds ComputeRequestTime ( const InvRequestTracker< InvId > &  requestTracker,
NodeId  nodeid,
const DataRequestParameters &  requestParams,
std::chrono::microseconds  current_time,
bool  preferred,
bool  bypass_limits 
)

Compute the request time for this announcement, current time plus delays for:

  • nonpref_peer_delay for announcements from non-preferred connections
  • overloaded_peer_delay for announcements from peers which have at least max_peer_request_in_flight requests in flight (and don't have the bypass_request_limits_permissions permission, i.e. bypass_limits is false).

Definition at line 414 of file invrequest.h.

Here is the call graph for this function:
Here is the caller graph for this function:

◆ TooManyAnnouncements()

template<class InvId >
bool TooManyAnnouncements ( const InvRequestTracker< InvId > &  requestTracker,
NodeId  nodeid,
const DataRequestParameters &  requestParams,
bool  bypass_limits 
)

Whether the peer already has too many announcements tracked to accept a new one.

Peers with the bypass_request_limits_permissions permission (bypass_limits = true) are not limited.

Definition at line 396 of file invrequest.h.

Here is the call graph for this function:
Here is the caller graph for this function: