<p>Sender will rebroadcast.</p>

<p>Fyi:</p>

<p>"though transactions will eventually be forgotten if they don't get into a block after a while. The sender and receiver of the transaction will rebroadcast, however."</p>

<p>from 
<a href="https://en.bitcoin.it/wiki/Network" rel="nofollow noreferrer">https://en.bitcoin.it/wiki/Network</a></p>

CC BY-SA 3.0
2017-11-23T09:25:59.333Z
2017-11-23T09:25:59.333Z
Wing Zhang
<p>Miners have mempools where they store all transactions they consider to include in future blocks. They don't put transactions they received into their blocks, right away.</p>

<p>But they don't put them into their mempool right away, either. The transactions in each miner's mempool are valid and worth the miner's effort (pay at least a certain amount of fee).</p>

<p>They can't even include all of the transactions they know about in their blocks, at the moment. Blocks can at most be 1 MB in size and because there currently are many transactions, the mempools of miners are much bigger than 1 MB.</p>

<p>At point 0 in time, the mempools look like this:</p>

<pre><code>mem_M1 = {A, B, C, D}
mem_M2 = {A, B, C}
</code></pre>

<p>When M2 solves the block, they remove all transactions they included in their block from their mempool:</p>

<pre><code>mem_M1 = {A, B, C, D}
mem_M2 = {}
</code></pre>

<p>M2 then sends the block to M1 who validates the newly received block. If M1 considers the block valid, they remove all transactions in that block from their mempool:</p>

<pre><code>mem_M1 = {D}
mem_M2 = {}
</code></pre>

<p>Note that D is still in there. M1 doesn't flush their mempool. Only the transactions included in the newly received blocks have been removed.</p>

<p>They then receive more transactions:</p>

<pre><code>mem_M1 = {D, E, F, G}
mem_M2 = {D, E, F, G}
</code></pre>

<p>Next, M1 solves a block and removes the transactions they included from their mempool:</p>

<pre><code>mem_M1 = {}
mem_M2 = {D, E, F, G}
</code></pre>

<p>After M1 sends their newly mined block to M2, M2 removes all transactions included in that block from their mempool:</p>

<pre><code>mem_M1 = {}
mem_M2 = {}
</code></pre>

<p>All transactions have been included in blocks.</p>

CC BY-SA 3.0
2016-12-29T13:49:23.327Z
2016-12-29T13:49:23.327Z
UTF-8
<p>I'm having a problem figuring out how miners solve the following problem:</p>

<p>Let's say we have 2 miners: M1, M2.</p>

<p>M1 adds transactions A,B,C,D to their block. M2 adds transactions A,B,C to their block. For some reason, transaction D will come to M2 a few seconds after M1 received it.</p>

<p>Now, M2 solves the block and sends this block to everyone. Consequently, M1 throws their block away and starts working on new block.</p>

<p>Next, M1 adds transactions E,F,G to their block, whereas M2 adds D,E,F,G (M2 gets D now) to their block. Now, M1 solves the block first and broadcasts it. Therefore, M2 throws their block away and starts a new one.</p>

<p><strong>In this case, transaction D won't get in any block!</strong> (The problem is caused by network speed which caused the fact that D arrived at M2 a few seconds after it got to M1.)</p>

<p>So, how is this problem handled or avoided?</p>

<blockchain><mining-theory><mempool><best-chain>
How do miners avoid transactions getting dropped?
Roy Kuper
# How do miners avoid transactions getting dropped?

(Asked by: username_0 on 2016-12-29)

I'm having a problem figuring out how miners solve the following problem:

Let's say we have 2 miners: M1, M2.

M1 adds transactions A,B,C,D to their block. M2 adds transactions A,B,C to their block. For some reason, transaction D will come to M2 a few seconds after M1 received it.

Now, M2 solves the block and sends this block to everyone. Consequently, M1 throws their block away and starts working on new block.

Next, M1 adds transactions E,F,G to their block, whereas M2 adds D,E,F,G (M2 gets D now) to their block. Now, M1 solves the block first and broadcasts it. Therefore, M2 throws their block away and starts a new one.

**In this case, transaction D won't get in any block!** (The problem is caused by network speed which caused the fact that D arrived at M2 a few seconds after it got to M1.)

So, how is this problem handled or avoided?

**Tags:** blockchain, mining-theory, mempool, best-chain


---

## 2 answers

### Answer by username_2 on 2016-12-29. Score: 3 | Accepted answer

Miners have mempools where they store all transactions they consider to include in future blocks. They don't put transactions they received into their blocks, right away.

But they don't put them into their mempool right away, either. The transactions in each miner's mempool are valid and worth the miner's effort (pay at least a certain amount of fee).

They can't even include all of the transactions they know about in their blocks, at the moment. Blocks can at most be 1 MB in size and because there currently are many transactions, the mempools of miners are much bigger than 1 MB.

At point 0 in time, the mempools look like this:

```
mem_M1 = {A, B, C, D}
mem_M2 = {A, B, C}

```

When M2 solves the block, they remove all transactions they included in their block from their mempool:

```
mem_M1 = {A, B, C, D}
mem_M2 = {}

```

M2 then sends the block to M1 who validates the newly received block. If M1 considers the block valid, they remove all transactions in that block from their mempool:

```
mem_M1 = {D}
mem_M2 = {}

```

Note that D is still in there. M1 doesn't flush their mempool. Only the transactions included in the newly received blocks have been removed.

They then receive more transactions:

```
mem_M1 = {D, E, F, G}
mem_M2 = {D, E, F, G}

```

Next, M1 solves a block and removes the transactions they included from their mempool:

```
mem_M1 = {}
mem_M2 = {D, E, F, G}

```

After M1 sends their newly mined block to M2, M2 removes all transactions included in that block from their mempool:

```
mem_M1 = {}
mem_M2 = {}

```

All transactions have been included in blocks.


---

### Answer by username_1 on 2017-11-23. Score: 1

Sender will rebroadcast.

Fyi:

"though transactions will eventually be forgotten if they don't get into a block after a while. The sender and receiver of the transaction will rebroadcast, however."

from
<https://en.bitcoin.it/wiki/Network>


---

