Regtest: One node nullifying other node's balance I'm running 2 bitcoind servers on the same machine, called node0 and node1.
In the following I'm listing steps I take and results I get and I'm wondering what is causing one node nullifying other node's balance by block generation?


Started two independent (by independent configuration files) servers
node0 generates 101 blocks
node1 generates 101 blocks
each node has a balance of 50 BTC
connected them by adding one by the other node via "addnode "localhost:port" add"
version messages are exchanged
getconnectioncount returns "1" on behalf of each node
node0 generates 1 block
node0: getbalance: 100 BTC
node1: getbalance: 0 BTC


...trying to figure out what's happening...


node1 generates 1 block
node1: getbalance: 0 BTC
node0: getbalance 150 BTC
node1 generates 100 blocks
node1: getbalance: 50 BTC
node0: getbalance: 5100 BTC


I guess this problem has to do with an error I get after generation of blocks - see my corresponding question here.

Or is it because of the settled connection which causes a conflict on which blockchain to work on and thus abandonning one node's blockchain - in this case, abandonning node1's blockchain?
You only see the balance of blocks that have at least another 100 on top. This is because coinbase outputs only become spendable after 101 confirmations (the maturity period).

After the nodes reconnect, and one block is mined by node0, node1's previous chain is reorganized away, and from that point on, both nodes work on the same chain.

However, whenever a new block is mined, the balance of the node who mined the block 100 before that is increased.

It has nothing to do with the nBits bug. This is an actual bug in the software which is being fixed now, but it does not affect you.