Skip to content

Conversation

brunoerg
Copy link
Contributor

This PR adds test coverage for the following init error:

bitcoin/src/init.cpp

Lines 931 to 935 in 5174a13

// mempool limits
int64_t nMempoolSizeMax = args.GetIntArg("-maxmempool", DEFAULT_MAX_MEMPOOL_SIZE) * 1000000;
int64_t nMempoolSizeMin = args.GetIntArg("-limitdescendantsize", DEFAULT_DESCENDANT_SIZE_LIMIT) * 1000 * 40;
if (nMempoolSizeMax < 0 || nMempoolSizeMax < nMempoolSizeMin)
return InitError(strprintf(_("-maxmempool must be at least %d MB"), std::ceil(nMempoolSizeMin / 1000000.0)));

By default, the minimum value is 5 MB. See:
https://github.com/bitcoin/bitcoin/blob/master/doc/reduce-memory.md#memory-pool

@fanquake fanquake added the Tests label Jun 13, 2022
@laanwj
Copy link
Member

laanwj commented Jun 15, 2022

Code review ACK 216c9b0

Copy link
Member

@furszy furszy left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Code review ACK 216c9b0

Min mempool value is actually 4,040,000 bytes.

@maflcko maflcko merged commit 6acba84 into bitcoin:master Jun 15, 2022
sidhujag pushed a commit to syscoin/syscoin that referenced this pull request Jun 15, 2022
…should throw an error

216c9b0 test: passing a value below 5 MB to -maxmempool should throw an error (brunoerg)

Pull request description:

  This PR adds test coverage for the following init error:
  https://github.com/bitcoin/bitcoin/blob/5174a139c92c1238f9700d06e362dc628d81a0a9/src/init.cpp#L931-L935

  By default, the minimum value is 5 MB. See:
  https://github.com/bitcoin/bitcoin/blob/master/doc/reduce-memory.md#memory-pool

ACKs for top commit:
  laanwj:
    Code review ACK 216c9b0
  furszy:
    Code review ACK 216c9b0

Tree-SHA512: 0c8fdcefb85e3dabb986a6294ad18503168a04246926614cbfa2d09d9e997312c937b01994f2999b1dc583e2eac5cdb8058bd58577baeb3eb23fdc690400cab9
@bitcoin bitcoin locked and limited conversation to collaborators Jun 15, 2023
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
Projects
None yet
Development

Successfully merging this pull request may close these issues.

5 participants