<p>You might be connected to both pools, but only working for one: When you mine, the block you are trying to find contains a recipient address for the block reward. Therefore, a block can only contribute to one mining pool (i.e. the one that would be receiving the reward, if the block was successful).</p>

<p>Whenever you find a block, the <code>#allblocks</code> mentioned in the linked thread, causes the block to be <em>propagated</em> to all connected pools. This will cause your block to be distributed quicker and prevent <em>selfish mining</em>:</p>

<p><em>Selfish mining</em> is something else than you seem to think: It describes a behavior, where a pool will keep a discovered block private, until another party finds a block or the pool itself finds a succeeding block. That way the pool can hinder other parties to base work on the discovered block, and can gain a "headstart" on a succeeding block.<br>
Due to you submitting your block to the pool and also propagating it to the network, the pool operator can't keep the block hidden and therefore cannot perform selfish mining.</p>

CC BY-SA 3.0
2015-03-18T17:37:59.287Z
2015-03-18T22:13:28.010Z
2015-03-18T22:13:28.010Z
Murch
<blockquote>
  <p>Now, if I discover a block, won't both my localhost GBT "pool" and the remote pool claim it as theirs?</p>
</blockquote>

<p>No. That isn't possible. Changing the coinbase transaction (what controls where a block reward goes) invalidates the block. All that happens is that the block propagates slightly faster.</p>

<p><a href="https://bitcoin.stackexchange.com/questions/11562/cheating-on-pooled-mining">Cheating on pooled mining</a></p>

<hr>

<blockquote>
  <p>This appears to be known as the "selfish mining attack."</p>
</blockquote>

<p>Actually, that's something else.</p>

<p><a href="https://bitcoin.stackexchange.com/a/23799/2306">Luca Matteis explains:</a></p>

<blockquote>
  <p>You're missing the main point: when a selfish miner finds a new block,
  he keeps it private, does not broadcast it to the network, and starts
  mining on top of that privately.</p>
  
  <p>The rest of the network is still mining on a block that was actually
  already found, but not broadcast.</p>
  
  <p>When the rest of the network finally finds this block, the selfish
  miner broadcasts his version, in an attempt to replace it.</p>
  
  <p>By invalidating blocks this way a selfish miner is effectively wasting
  other people's cycles, and has a head start for winning the next
  block, because he started mining on it before the others.</p>
</blockquote>

CC BY-SA 3.0
2015-03-18T17:36:12.447Z
2015-03-18T17:36:12.447Z
2017-04-13T12:47:33.610Z
Nick ODell
<p>It's possible to send shares both to a localhost GBT "pool" (e.g., Bitcoin Core's) and to a remote Stratum pool.* Now, if I discover a block, won't both my localhost GBT "pool" and the remote pool claim it as theirs? This appears to be known as the "<a href="https://bitcointalk.org/index.php?topic=877081.msg10724466#msg10724466" rel="nofollow">selfish mining attack</a>."</p>

<p><sup>*using, e.g., <a href="https://bitcointalk.org/index.php?topic=877081.msg9686533#msg9686533" rel="nofollow"><code>bfgminer</code></a>'s <code>#allblocks</code> option, which offers "Support for submitting found blocks to a local Bitcoin GBT server (bitcoind or Bitcoin-Qt with -server flag): just append #allblocks to the end of your bitcoind's URI." (<a href="https://bitcointalk.org/index.php?topic=877081.msg9686533#msg9686533" rel="nofollow">source</a>)</sup></p>

<mining-pools><attack><solo-mining><bfgminer><stratum>
Simultaneously Solo and Pool Mining
Geremia
# Simultaneously Solo and Pool Mining

(Asked by: username_0 on 2015-03-18)

It's possible to send shares both to a localhost GBT "pool" (e.g., Bitcoin Core's) and to a remote Stratum pool.\* Now, if I discover a block, won't both my localhost GBT "pool" and the remote pool claim it as theirs? This appears to be known as the "[selfish mining attack](https://bitcointalk.org/index.php?topic=877081.msg10724466#msg10724466)."

\*using, e.g., [`bfgminer`](https://bitcointalk.org/index.php?topic=877081.msg9686533#msg9686533)'s `#allblocks` option, which offers "Support for submitting found blocks to a local Bitcoin GBT server (bitcoind or Bitcoin-Qt with -server flag): just append #allblocks to the end of your bitcoind's URI." ([source](https://bitcointalk.org/index.php?topic=877081.msg9686533#msg9686533))

**Tags:** mining-pools, attack, solo-mining, bfgminer, stratum


---

## 2 answers

### Answer by username_1 on 2015-03-18. Score: 2 | Accepted answer

You might be connected to both pools, but only working for one: When you mine, the block you are trying to find contains a recipient address for the block reward. Therefore, a block can only contribute to one mining pool (i.e. the one that would be receiving the reward, if the block was successful).

Whenever you find a block, the `#allblocks` mentioned in the linked thread, causes the block to be *propagated* to all connected pools. This will cause your block to be distributed quicker and prevent *selfish mining*:

*Selfish mining* is something else than you seem to think: It describes a behavior, where a pool will keep a discovered block private, until another party finds a block or the pool itself finds a succeeding block. That way the pool can hinder other parties to base work on the discovered block, and can gain a "headstart" on a succeeding block.  
Due to you submitting your block to the pool and also propagating it to the network, the pool operator can't keep the block hidden and therefore cannot perform selfish mining.


---

### Answer by username_2 on 2015-03-18. Score: 3

> Now, if I discover a block, won't both my localhost GBT "pool" and the remote pool claim it as theirs?

No. That isn't possible. Changing the coinbase transaction (what controls where a block reward goes) invalidates the block. All that happens is that the block propagates slightly faster.

[Cheating on pooled mining](https://bitcoin.stackexchange.com/questions/11562/cheating-on-pooled-mining)

---

> This appears to be known as the "selfish mining attack."

Actually, that's something else.

[Luca Matteis explains:](https://bitcoin.stackexchange.com/a/23799/2306)

> You're missing the main point: when a selfish miner finds a new block,
> he keeps it private, does not broadcast it to the network, and starts
> mining on top of that privately.
>
> The rest of the network is still mining on a block that was actually
> already found, but not broadcast.
>
> When the rest of the network finally finds this block, the selfish
> miner broadcasts his version, in an attempt to replace it.
>
> By invalidating blocks this way a selfish miner is effectively wasting
> other people's cycles, and has a head start for winning the next
> block, because he started mining on it before the others.


---

