HomePhabricator

refactor: Make CTxMemPool::m_check_ratio a const and a constructor argument

Description

refactor: Make CTxMemPool::m_check_ratio a const and a constructor argument

Summary:
Since m_check_ratio is only set once and since the CTxMemPool object is
no longer a global variable, m_check_ratio can be passed into the
constructor of CTxMemPool. Since it is only read from after
initialization, m_check_ratio can also be made a const and hence no
longer needs to be guarded by the cs mutex.

This is a backport of core#20222 [2/3]
https://github.com/bitcoin/bitcoin/pull/20222/commits/e3310692d0e9720e960b9785274ce1f0b58b4cd7

Depends on D10841

Test Plan:
With TSAN:
ninja && ninja check check-functional

Reviewers: #bitcoin_abc, Fabien

Reviewed By: #bitcoin_abc, Fabien

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

Details

Provenance
Elle Mouton <elle.mouton@gmail.com>Authored on Oct 20 2020, 18:42
PiRKCommitted on Jan 19 2022, 17:21
PiRKPushed on Jan 19 2022, 17:21
Reviewer
Restricted Project
Differential Revision
D10842: refactor: Make CTxMemPool::m_check_ratio a const and a constructor argument
Parents
rABC457744047921: refactor: Avoid double to int cast for nCheckFrequency
Branches
Unknown
Tags
Unknown