Merge bitcoin/bitcoin#25358: test: passing a value below 5 MB to -maxmempool should throw an error

216c9b00ec 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:
  5174a139c9/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 216c9b00ec
  furszy:
    Code review ACK 216c9b00

Tree-SHA512: 0c8fdcefb85e3dabb986a6294ad18503168a04246926614cbfa2d09d9e997312c937b01994f2999b1dc583e2eac5cdb8058bd58577baeb3eb23fdc690400cab9
This commit is contained in:
MacroFake 2022-06-15 19:24:03 +02:00
commit 6acba84603
No known key found for this signature in database
GPG Key ID: CE2B75697E69A548

View File

@ -77,6 +77,10 @@ class MempoolLimitTest(BitcoinTestFramework):
self.log.info('Create a mempool tx that will not pass mempoolminfee') self.log.info('Create a mempool tx that will not pass mempoolminfee')
assert_raises_rpc_error(-26, "mempool min fee not met", miniwallet.send_self_transfer, from_node=node, fee_rate=relayfee) assert_raises_rpc_error(-26, "mempool min fee not met", miniwallet.send_self_transfer, from_node=node, fee_rate=relayfee)
self.log.info('Test passing a value below the minimum (5 MB) to -maxmempool throws an error')
self.stop_node(0)
self.nodes[0].assert_start_raises_init_error(["-maxmempool=4"], "Error: -maxmempool must be at least 5 MB")
if __name__ == '__main__': if __name__ == '__main__':
MempoolLimitTest().main() MempoolLimitTest().main()