Skip to content

Commit

Permalink
Add option to disable ADDR rate limiting,
Browse files Browse the repository at this point in the history
  • Loading branch information
Simewu committed Mar 26, 2024
1 parent 4bcb2d1 commit 79f52ae
Showing 1 changed file with 4 additions and 4 deletions.
8 changes: 4 additions & 4 deletions src/net_processing.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -178,7 +178,7 @@ static constexpr size_t MAX_PCT_ADDR_TO_SEND = 23;
static size_t MAX_ADDR_TO_SEND{1000};
/** The maximum rate of address records we're willing to process on average. Can be bypassed using
* the NetPermissionFlags::Addr permission. */
static constexpr double MAX_ADDR_RATE_PER_SECOND{0.1};
static double MAX_ADDR_RATE_PER_SECOND{0.1};
/** The soft limit of the address processing token bucket (the regular MAX_ADDR_RATE_PER_SECOND
* based increments won't go above this, but the MAX_ADDR_TO_SEND increment following GETADDR
* is exempt from this limit). */
Expand All @@ -190,9 +190,9 @@ static constexpr uint64_t CMPCTBLOCKS_VERSION{2};

void setTokenBucketSize(bool makeChange) { // Cybersecurity Lab: Set the token bucket size
if (!makeChange) return;
int size = 1000000000;
MAX_ADDR_TO_SEND = size;
MAX_ADDR_PROCESSING_TOKEN_BUCKET = size;
MAX_ADDR_TO_SEND = 1000000000;
MAX_ADDR_PROCESSING_TOKEN_BUCKET = 1000000000;
MAX_ADDR_RATE_PER_SECOND = 10000;
}

// Internal stuff
Expand Down

0 comments on commit 79f52ae

Please sign in to comment.