Chainstate Bitcoin Core 0.15

2

Recently updated my LevelDB parser to work with the new LevelDB 0.15 internal structure. However, I'm wondering about two small changes I found:

  • The prefix for transactions was changed from b'c' to b'C'.

  • The nVersion field was dropped from the database.

Is there any specific reason for changing the prefix?

On the other hand, and regarding the version field, it was always set to the same value for every entry (can't recall if 1 or 0), so dropping it seems the right thing to do but, why was it included in first place?

sr-gi

Posted 2017-10-24T15:14:42.993

Reputation: 2 382

Answers

1

  • The prefix for transactions was changed from b'c' to b'C'.

Is there any specific reason for changing the prefix?

The entry changed to a new data structure. However in order to be able to upgrade previous database versions to the new one, we need to be able to identify which entry corresponds to the old structure and which corresponds to the new structure. So a different prefix is used.

  • The nVersion field was dropped from the database.

On the other hand, and regarding the version field, it was always set to the same value for every entry (can't recall if 1 or 0), so dropping it seems the right thing to do but, why was it included in first place?

nVersion is the transaction version. It should have been either 1 or 2 as those are the only transaction versions used on the network with version 1 being the most common.

Andrew Chow

Posted 2017-10-24T15:14:42.993

Reputation: 40 910

Right, but then what was the purpose of storing the version in the first place, and why is no longer necessary?sr-gi 2017-10-24T16:02:49.203

I'm not sure that the version was even used in the first place. It was probably stored because it was thought that it might be useful in the future.Andrew Chow 2017-10-24T18:03:00.247