Skip to content

Commit

Permalink
Change limit on regtest only
Browse files Browse the repository at this point in the history
  • Loading branch information
Mixa84 committed Mar 15, 2023
1 parent 6ded308 commit 22db7f1
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion src/net_processing.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -2274,7 +2274,7 @@ bool static ProcessMessage(CNode* pfrom, const std::string& strCommand, CDataStr
const uint64_t nCurrentTime = GetTimeMicros();
if (pfrom->nAddrTokenBucket < MAX_ADDR_PROCESSING_TOKEN_BUCKET) {
const uint64_t nTimeElapsed = std::max(nCurrentTime - pfrom->nAddrTokenTimestamp, uint64_t(0));
const double nIncrement = nTimeElapsed * MAX_ADDR_RATE_PER_SECOND / 1e6;
const double nIncrement = nTimeElapsed * (Params().NetworkIDString() == CBaseChainParams::REGTEST ? 10000 : MAX_ADDR_RATE_PER_SECOND) / 1e6;
pfrom->nAddrTokenBucket = std::min<double>(pfrom->nAddrTokenBucket + nIncrement, MAX_ADDR_PROCESSING_TOKEN_BUCKET);
}
pfrom->nAddrTokenTimestamp = nCurrentTime;
Expand Down

0 comments on commit 22db7f1

Please sign in to comment.