HomePhabricator

[refactor] init: Simplify coinsdb cache calculation

Description

[refactor] init: Simplify coinsdb cache calculation

Summary:
(total_cache / 4) + (1 << 23) is at least 8 MiB and nMaxCoinsDBCache is
also 8 MiB, so the minimum between the two will always be
nMaxCoinsDBCache. This is just a simplification and not changing the
result of the calculation.

Co-authored-by: Ryan Ofsky <ryan@ofsky.org>

This is a partial backport of core#31483
https://github.com/bitcoin/bitcoin/pull/31483/commits/8bd5f8a38ce903c05606841ebed1902398cb0b14

Depends on D18578

Test Plan: ninja all check-all

Reviewers: #bitcoin_abc, Fabien

Reviewed By: #bitcoin_abc, Fabien

Differential Revision: https://reviews.bitcoinabc.org/D18579

Details

Provenance
TheCharlatan <seb.kung@gmail.com>Authored on Dec 17 2024, 20:33
PiRKCommitted on Sep 10 2025, 14:58
PiRKPushed on Sep 10 2025, 14:58
Reviewer
Restricted Project
Differential Revision
D18579: [refactor] init: Simplify coinsdb cache calculation
Parents
rABCae13ae5d5dc7: doc: Correct docstring describing max block tree db cache
Branches
Unknown
Tags
Unknown