Page MenuHomePhabricator

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

Authored by PiRK on Jan 19 2022, 15:11.

Details

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