<blockquote>
  <p>When a previously unknown chain fork of at least 7 blocks length is published, how does Bitcoin Core react?</p>
</blockquote>

<p>It reorganizes to that chain, any transactions that were lost are returned to the nodes mempool. </p>

<blockquote>
  <p>Would Bitcoin Core accept the chain fork if it had the most work?</p>
</blockquote>

<p>Any valid chain with the most work will be reorganised to. </p>

<blockquote>
  <p>How prominent is the warning to the user?</p>
</blockquote>

<p>That warning isn't shown to a user in a reorganisation. Users are shown a warning when there is a significantly higher chain than them with valid proof of work but invalid contents, or alternatively when a soft fork takes the block version number higher than their client is aware of. When a warning is shown to a uiser through the alert system, it is either in the <code>alerts</code> field of the RPC output or in a small yellow bar in the GUI client. </p>

<p><img src="https://i.sstatic.net/eof8u.png" alt="small yellow bar"></p>

<blockquote>
  <p>Does Bitcoin Core need manual intervention to decide which fork to accept?</p>
</blockquote>

<p>The code has the rules, if users made their own decisions about what constituted "valid" the network would fragment. There is no concept of an "evil" chain or an "attacking" chain, only the best chain.  </p>

CC BY-SA 3.0
2015-06-24T17:19:22.523Z
2015-06-24T17:24:39.680Z
2015-06-24T17:24:39.680Z
Claris
<p>I tried answering a <a href="https://bitcoin.stackexchange.com/q/38202/5406">question about a majority-attacker's power to change the blockchain</a> yesterday.</p>

<p>There is one thing I haven't been able to get a clear picture on, yet:<br>
When a previously unknown chain fork of at least 7 blocks length is published, how does Bitcoin Core react?</p>

<p><a href="https://github.com/bitcoin/bitcoin/blob/master/src/main.cpp#L1230" rel="nofollow noreferrer">main.h: CheckForkWarningConditions</a> appears to emit a warning stating "Chain state database corruption likely".</p>

<p>Would Bitcoin Core accept the chain fork if it had the most work? How prominent is the warning to the user? Does Bitcoin Core need manual intervention to decide which fork to accept?</p>

<bitcoin-core-development><majority-attack><chain-reorganization>
When an attacker publishes a longer chain, does Bitcoin Core emit a warning?
Murch
# When an attacker publishes a longer chain, does Bitcoin Core emit a warning?

(Asked by: username_0 on 2015-06-24)

I tried answering a [question about a majority-attacker's power to change the blockchain](https://bitcoin.stackexchange.com/q/38202/5406) yesterday.

There is one thing I haven't been able to get a clear picture on, yet:  
When a previously unknown chain fork of at least 7 blocks length is published, how does Bitcoin Core react?

[main.h: CheckForkWarningConditions](https://github.com/bitcoin/bitcoin/blob/master/src/main.cpp#L1230) appears to emit a warning stating "Chain state database corruption likely".

Would Bitcoin Core accept the chain fork if it had the most work? How prominent is the warning to the user? Does Bitcoin Core need manual intervention to decide which fork to accept?

**Tags:** bitcoin-core-development, majority-attack, chain-reorganization


---

## 1 answers

### Answer by username_1 on 2015-06-24. Score: 4 | Accepted answer

> When a previously unknown chain fork of at least 7 blocks length is published, how does Bitcoin Core react?

It reorganizes to that chain, any transactions that were lost are returned to the nodes mempool.

> Would Bitcoin Core accept the chain fork if it had the most work?

Any valid chain with the most work will be reorganised to.

> How prominent is the warning to the user?

That warning isn't shown to a user in a reorganisation. Users are shown a warning when there is a significantly higher chain than them with valid proof of work but invalid contents, or alternatively when a soft fork takes the block version number higher than their client is aware of. When a warning is shown to a uiser through the alert system, it is either in the `alerts` field of the RPC output or in a small yellow bar in the GUI client.

![small yellow bar](https://i.sstatic.net/eof8u.png)

> Does Bitcoin Core need manual intervention to decide which fork to accept?

The code has the rules, if users made their own decisions about what constituted "valid" the network would fragment. There is no concept of an "evil" chain or an "attacking" chain, only the best chain.


---

