This improves a few more things through the use of CTransactionRef
(aka std::shared_ptr<const CTransaction>
):
- By making
AcceptToMemoryPool
take a CTransactionRef, we can move transactions during a reorg back from loaded blocks to the mempool without copying them. - By making COrphanTx store a
CTransactionRef
, we can avoid a copy when orphans move to the mempool. - By making
PartiallyDownloadedBlock::FillBlock
consume its previously-initialized state, we can avoid 2 atomic refcount updates per mempool-found transaction in a reconstructed compact block.