The mempool actually stores CTxMemPoolEntry objects, which are wrappers
around transactions with added/cached statistics. Since there is a
single mempool this is not a problem and all the algorithms are using
iterators and/or references to manipulate the objects that remain owned
by the mempool.
With pre-consensus we will need to move these entries to other data
structures: the conflicting txs will be voted on and need to be stored,
and we want to build a tree of the finalized txs that will be used to
generate the block template.
In order to not lose and having to recompute the cached data (especially
the fees) we need to be able to move the entries from one container to
another. Using a shared pointer is a stop in this direction. In the end
we will probably use a RCUPtr but this require additional refactors,
as it makes the entry non copyable. This first step is the purpose of
this diff.
Depends on D13439 and D13440.