Chain Split Fix

A split chain

Over the past few days we’ve discovered a series of chain splits (read more here) that have occurred. A chain split essentially occurs when nodes disagree on who should win a masternode reward and the network splits in two. We’ve traced the cause of the splits to a change added in the protocol update at block 260,000 (detailed in this blog post). This was also exacerbated by a number of wallets having difficulty staking. Further, the block explorers themselves were on incorrect chains, which caused even more confusion, as people had no frame of reference for checking if they were on the right chain. After a restless 48 hours, with a lot of help from some dedicated community members, all three issues are now fixed. Chain splits should now no longer occur. Now we just need to make sure we are all on the correct chain by following the simple guide outlined below.


Issue 1: Block Explorers

For a period of time the explorer at explorer.savebitcoin.io was down and the explorer at coinexplorer.net was on the wrong chain. Both explorers are now on the correct chain.

Explorer #1: https://explorer.savebitcoin.io/

Explorer #2: https://www.coinexplorer.net/BITG


Issue 2: Getting Back on Correct Chain

  • If you have a GUI Wallet (Mac/Windows), follow the GUI GUIDE (below).
  • If you have a Linux wallet, follow the LINUX GUIDE (below).
  • If you have a GUI controller+cold wallet setup, follow both guides for all your wallets.

GUI (Windows/Mac) GUIDE:

Step 1: Check that you are on the correct chain.

Go to Tools->Information and look at “Current number of blocks” to find the block your wallet is currently on:

Next go to https://explorer.savebitcoin.io/api/getblockcount (there will be number in top left of browser) and confirm if the block count is the same. If it is off by one or two, it may be due to a delay in when you checked. So check back and forth a few times to be sure.

  • If your block count is the same on both your wallet and the explorer then you are on the correct chain and there is nothing you need to do for the GUI wallet.
  • If you have any nodes running on Linux, you will need to also follow the Linux guide below.
  • If your block counts are different then you are on the incorrect chain, continue with step 2 below.

Step 2: Connect to Correct Chain

You have 2 options:

Option 1: Resync (easy option, but slower)

In the GUI wallet, go to Tools->Wallet Repair and click “Delete local Blockchain Files”.

Your node will resync from scratch. After syncing, confirm you are on the correct chain by following step 1 above. If for whatever reason you are not on the correct chain after resyncing, then you will need to use the bootstrap method (option 2 below).

Option 2: Bootstrap (more steps but faster)

Close your wallet.

Find and delete the existing blocks/ and chainstate/ folders that are installed.

For Mac, open Finder (just click your desktop), press cmd+shift+G, go to ~/Library/Application Support/BitcoinGreen

For Windows, go to %APPDATA%/BitcoinGreen

After deleting the existing blocks/ and chainstate/ folders, download the official bootstrap at explorer.savebitcoin.io/bootstrap/chain.zip. Inside chain.zip you will find new copies of blocks/ and chainstate/. Copy those over to the same location as the original chainstate/ and blocks/ folders.

Reopen your wallet and wait for the bootstrap process to finish. You should now be on the correct chain (confirm by following step 1 above).

LINUX GUIDE:

Step 1: Check that you are on the correct chain.

(Note: for all commands listed below, replace ALIAS with the name of your node, probably ‘mn1’ or something similar.)

In the terminal, enter:

bitcoingreen-cli_ALIAS.sh getblockchaininfo

Note the number of blocks besides “blocks”. Go to https://explorer.savebitcoin.io/api/getblockcount (there will be a number in the top left of your browser) and confirm if the block count is the same. If it is off by one or two, it may be due to delay in when you checked. So look back and forth a few times.

  • If your block count is the same you are on the correct chain and there is nothing you need to do.
  • If your block count is different then you are on the incorrect chain, continue with option 1 or option 2 in step 2 below.

Step 2: Connect to Correct Chain

You have 2 options:

Option 1: Resync (easy option, but slower)

In the terminal, enter:

bitcoingreen-cli_ALIAS.sh stop

Wait ~15 seconds for the node to stop.

Resync your node:

bitcoingreend_ALIAS.sh --resync

To track the progress of the resync, you can enter:

bitcoingreen-cli_ALIAS.sh getblockchaininfo

If for whatever reason you are not on the correct chain after resyncing, then you will need to use the bootstrap method (option 2 below).

Option 2: Bootstrap (more steps but faster)

Stop your wallet:

bitcoingreen-cli_ALIAS.sh stop

Wait ~15 seconds for the node to stop.

Go to .bitcoingreen_ALIAS/ directory or wherever your chainstate and blocks folders are stored:

cd ~/.bitcoingreen_ALIAS/

Delete the blocks and chainstate folders:

rm -rf blocks/
rm -rf chainstate/

Download the official bootstrap file:

wget https://explorer.savebitcoin.io/bootstrap/bootstrap.dat

(Shortcut: if you have a lot of nodes, download the above to your home directory and just copy it to each node’s folder)

(Alternatively you can download https://explorer.savebitcoin.io/bootstrap/chain.zip, unzip and copy over chainstate and blocks folders)

Restart your wallet:

bitcoingreend_ALIAS.sh

To track the progress of the resync, you can enter:

bitcoingreen-cli_ALIAS.sh getblockchaininfo

Issue 3: Issues with staking on some wallets

There have been multiple reports of individuals have trouble getting their staking to work since the hardfork at block 260,000. We have released a new wallet build that is designed to resolve these issues. It is very important that staking works perfectly, as stakers are critical in securing the network. We believe the lack of individuals able to stake exacerbated the issue over the past few days. Note that this is not a required update. Please check out the 1.2.2 release at: https://github.com/bitcoingreen/bitcoingreen/releases


Please direct any questions to our Discord channels #mn-help or #wallet-help. We are providing full technical support to ensure everyone in the community is able able to stake smoothly on the Bitcoin Green network.

If you have any questions, please reach out on Discord or contact us at awareness@savebitcoin.io.