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?

1 Answer 1

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.

2
  • Right, but then what was the purpose of storing the version in the first place, and why is no longer necessary?
    – sr_gi
    Oct 24, 2017 at 16:02
  • 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
    Oct 24, 2017 at 18:03

Your Answer

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

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