user18866: I am not clear as to how the removal of transactions from the non-confirmed pool happens.  I have not found any descriptions explaining how the process works.
Here are the scenarios as I see them:
A) When a node selects a set of transactions to be included in a possible block it removes them from the non-confirmed pool.  So if/when the node solves the block there is no clean up necessary of the not-confirmed pool.
B) Transactions may be included in multiple potential blocks and remain in the not-confirmed pool while blocks are being solved, then when a block is solved the transactions included in the block are removed from the not-confirmed pool.  This sounds to me as the most likely scenario but it is not clear at all who/when removes the transactions from the not-confirmed pool. 

user208: In Bitcoin Core, the memory pool is a consistent set of transactions that can legally follow the best known block. As already mentioned, there is no guarantee of consistency between different nodes' mempools.
In practice that means:

when a new block is accepted (received from the network or locally mined), all transactions in it are removed from the mempool, while their dependencies are kept.
when a new block is accepted, all transactions that conflict with transactions in that block, plus all their dependencies, are removed from the mempool.
when a block is reorganized (disconnected), its transactions are attempted to add back to the mempool in reverse order (since they may interdependent), unless they conflict with transactions already there.


18866: <p>I am not clear as to how the removal of transactions from the non-confirmed pool happens.  I have not found any descriptions explaining how the process works.</p>

<p>Here are the scenarios as I see them:</p>

<p>A) When a node selects a set of transactions to be included in a possible block it removes them from the non-confirmed pool.  So if/when the node solves the block there is no clean up necessary of the not-confirmed pool.</p>

<p>B) Transactions may be included in multiple potential blocks and remain in the not-confirmed pool while blocks are being solved, then when a block is solved the transactions included in the block are removed from the not-confirmed pool.  This sounds to me as the most likely scenario but it is not clear at all who/when removes the transactions from the not-confirmed pool. </p>
 208: <p>In Bitcoin Core, the memory pool is a consistent set of transactions that can legally follow the best known block. As already mentioned, there is no guarantee of consistency between different nodes' mempools.</p>

<p>In practice that means:</p>

<ul>
<li>when a new block is accepted (received from the network or locally mined), all transactions in it are removed from the mempool, while their dependencies are kept.</li>
<li>when a new block is accepted, all transactions that conflict with transactions in that block, plus all their dependencies, are removed from the mempool.</li>
<li>when a block is reorganized (disconnected), its transactions are attempted to add back to the mempool in reverse order (since they may interdependent), unless they conflict with transactions already there.</li>
</ul>
