1


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?

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

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

  1. node1 generates 1 block
  2. node1: getbalance: 0 BTC
  3. node0: getbalance 150 BTC
  4. node1 generates 100 blocks
  5. node1: getbalance: 50 BTC
  6. 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?

1 Answer 1

4

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.

3
  • Thanks! But does it make sense to earn bitcoins without generating any blocks? Because apperently, node0, in this case, is earning the reward from the blocks node1 generates!? Or am I misunderstanding/missing something? Commented May 3, 2015 at 22:00
  • You are misunderstanding. In step 11, node1 generates block number 103. This is the 100th block on top of block number 3, whose coinbase matures at that point. This makes block number 3's generated coin (which belongs to node0, not node1), spendable. Commented May 4, 2015 at 9:24
  • Ah ok, of course, because both bodes work on node0's blockchain. Thanks! Commented May 4, 2015 at 9:34

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Not the answer you're looking for? Browse other questions tagged or ask your own question.