<p>The way to do this is to validate each and every block before beginning work on the next block.  If you validate the block you will have verified each and every transaction included in the block.  This then gives you the knowledge you need to determine if particular transactions were included or not.  When they have been included in a block they are also removed from the mempool.  The process of first validating a block can be slow and is not always popular so many miners take shortcuts and mine using SPV (only the headers)  they are thus unaware of which transactions are included in each block while validation is occurring so to keep miner busy they will mine a block without including any transactions.</p>

CC BY-SA 3.0
2016-09-04T19:26:27.027Z
2016-09-04T19:26:27.027Z
Mark S.
<p>I am trying to fully understand the block chain algorithm and in particular, the consensus.</p>

<p>My understanding is each miner has a pool of pending events -- events that have not yet been included in a block --.</p>

<p>What I can't get my head around is if I'm busy mining events A, B &amp; C into a block. Then in the mean time, a new block arrives that already includes event A, and its chain represent the "most work chain". I should abandon my effort to mine and start mining again after this new block.</p>

<p>If that's the case, then when I restart mining, my pending events should only have B and C. That I understand.</p>

<p>But if the new block that now becomes the head of the block chain was not parented by my current main block, that means that I could duplicate event B &amp; C (if the parent of the new block contained them).</p>

<p>So how do I need to manage pending events? Do I need to go back the new chain to make sure I don't make duplicates? </p>

<blockchain><algorithms>
Mining and pending events
mprivat
# Mining and pending events

(Asked by: username_0 on 2016-09-02)

I am trying to fully understand the block chain algorithm and in particular, the consensus.

My understanding is each miner has a pool of pending events -- events that have not yet been included in a block --.

What I can't get my head around is if I'm busy mining events A, B & C into a block. Then in the mean time, a new block arrives that already includes event A, and its chain represent the "most work chain". I should abandon my effort to mine and start mining again after this new block.

If that's the case, then when I restart mining, my pending events should only have B and C. That I understand.

But if the new block that now becomes the head of the block chain was not parented by my current main block, that means that I could duplicate event B & C (if the parent of the new block contained them).

So how do I need to manage pending events? Do I need to go back the new chain to make sure I don't make duplicates?

**Tags:** blockchain, algorithms


---

## 1 answers

### Answer by username_1 on 2016-09-04. Score: 1 | Accepted answer

The way to do this is to validate each and every block before beginning work on the next block. If you validate the block you will have verified each and every transaction included in the block. This then gives you the knowledge you need to determine if particular transactions were included or not. When they have been included in a block they are also removed from the mempool. The process of first validating a block can be slow and is not always popular so many miners take shortcuts and mine using SPV (only the headers) they are thus unaware of which transactions are included in each block while validation is occurring so to keep miner busy they will mine a block without including any transactions.


---

