Similarly to how #18698 added ProcessNewBlock()
and ProcessNewBlockHeaders()
methods to the ChainstateManager
class, this PR adds a new ProcessTransaction()
method. Code outside validation no longer calls AcceptToMemoryPool()
directly, but calls through the higher-level ProcessTransaction()
method. Advantages:
- The interface is simplified. Calling code no longer needs to know about the active chainstate or mempool object, since
AcceptToMemoryPool()
can only ever be called for the active chainstate, and that chainstate knows which mempool it’s using. We can also remove thebypass_limits
argument, since that can only be used internally in validation. - responsibility for calling
CTxMemPool::check()
is removed from the callers, and run automatically byChainstateManager
every timeProcessTransaction()
is called.