HomePhabricator

[refactor] pass CTxMempool& to DisconnectedBlockTransactions methods

Description

[refactor] pass CTxMempool& to DisconnectedBlockTransactions methods

Summary:
This was originally feedback given to me on D6539. Since then I've decided to pass CTxMemPool to the addForBlock method too. This avoids having to declare an extern CTxMemPool g_mempool symbol on txmempool.h, and is nicer in general.

Alternatively, I've considered adding a CTxMemPool& m_pool to DisconnectedBlockTransactions plus an explicit constructor on the assumption that such objects can only ever have one mempool they work with, but went with this instead for simplicity.

The above changes are unrelated to PR14193 however, so I'm putting them on a separate diff not to overcomplicate review of the latter.

Test Plan:

ninja check check-functional

Reviewers: #bitcoin_abc, deadalnix

Reviewed By: #bitcoin_abc, deadalnix

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

Details

Provenance
majcostaAuthored on Sep 14 2020, 21:21
majcostaPushed on Sep 25 2020, 17:28
Reviewer
Restricted Project
Differential Revision
D7439: [refactor] pass CTxMempool& to DisconnectedBlockTransactions methods
Parents
rABCf28cb937a427: [backport#19450] ci: Add tsan suppression for race in BerkeleyBatch
Branches
Unknown
Tags
Unknown