<p>A block is valid only if it obeys all the protocol rules.  If it is invalid, it will not be relayed:</p>

<ul>
<li><a href="http://en.bitcoin.it/wiki/Invalid_block" rel="nofollow">http://en.bitcoin.it/wiki/Invalid_block</a></li>
</ul>

<p>Now the client does maintain side chains.  So if there is the main branch and a side branch, even though the node included a transaction in the main branch doesn't mean it will reject a block for the side branch just because it too contains the same transaction.  So for each branch it is determined if that block was valid or not.</p>

<p>But there is a rule that valid blocks are only relayed if they are added to the (new) main branch / best known chain (thanks to Pieter for the correction).</p>

<p>As far as a new transaction being relayed - if it is invalid for the main branch (e.g., double spend) then it will not be relayed by the node.</p>

<p>So a transaction is either already in a block in the main branch already (and thus would be rejected if it is a double spend) or it isn't in the main branch and will as a result always be relayed.</p>

<p>This will be relayed even if that transaction is already included in a block in the side chain.</p>

CC BY-SA 3.0
2014-05-22T20:43:39.787Z
@PieterWuille, Doesn't this depend on the client? What's stopping a rogue client from relaying invalid blocks?
Pacerier
CC BY-SA 3.0
2014-05-22T21:49:22.673Z
Nothing. Which is why everyone else who cares verifies them :)
Pieter Wuille
CC BY-SA 3.0
2012-09-13T03:08:36.857Z
Almost correct. Only valid blocks and transactions are relayed, but for blocks there is another rule: they're only relayed if they are part of the (new) best known chain. Relaying blocks in sidechains is usually a waste of work anyway.
Pieter Wuille
CC BY-SA 3.0
2012-09-12T21:45:19.113Z
2012-09-14T04:12:00.343Z
2012-09-14T04:12:00.343Z
Stephen Gornick
<p>Each node has a very clear view of what is valid and what is not. With conflicting blocks (Blockchain fork) or transactions (double-spending attack) it will always choose the first it sees, until it gets prove otherwise (longer blockchain or other transaction is included in a block).</p>

<p>I'm wondering whether the Satoshi Client relays any of the transactions or blocks he thinks are not valid. So will I ever see a transaction if all my neighbors have seen a conflicting transaction first? Will I see forked blocks if all my neighbors agree on which block came first?</p>

<transactions><blockchain><network>
Do transactions and blocks get relayed even if a node believes them to be invalid?
cdecker
# Do transactions and blocks get relayed even if a node believes them to be invalid?

(Asked by: username_0 on 2012-09-12)

Each node has a very clear view of what is valid and what is not. With conflicting blocks (Blockchain fork) or transactions (double-spending attack) it will always choose the first it sees, until it gets prove otherwise (longer blockchain or other transaction is included in a block).

I'm wondering whether the Satoshi Client relays any of the transactions or blocks he thinks are not valid. So will I ever see a transaction if all my neighbors have seen a conflicting transaction first? Will I see forked blocks if all my neighbors agree on which block came first?

**Tags:** transactions, blockchain, network


---

## 1 answers

### Answer by username_1 on 2012-09-12. Score: 4 | Accepted answer

A block is valid only if it obeys all the protocol rules. If it is invalid, it will not be relayed:

* <http://en.bitcoin.it/wiki/Invalid_block>

Now the client does maintain side chains. So if there is the main branch and a side branch, even though the node included a transaction in the main branch doesn't mean it will reject a block for the side branch just because it too contains the same transaction. So for each branch it is determined if that block was valid or not.

But there is a rule that valid blocks are only relayed if they are added to the (new) main branch / best known chain (thanks to username_3 for the correction).

As far as a new transaction being relayed - if it is invalid for the main branch (e.g., double spend) then it will not be relayed by the node.

So a transaction is either already in a block in the main branch already (and thus would be rejected if it is a double spend) or it isn't in the main branch and will as a result always be relayed.

This will be relayed even if that transaction is already included in a block in the side chain.

> **Comments:**
> **username_3**: Almost correct. Only valid blocks and transactions are relayed, but for blocks there is another rule: they're only relayed if they are part of the (new) best known chain. Relaying blocks in sidechains is usually a waste of work anyway.  
> **username_2**: @username_3, Doesn't this depend on the client? What's stopping a rogue client from relaying invalid blocks?  
> **username_3**: Nothing. Which is why everyone else who cares verifies them :)  

---

