Chainstate LevelDB corruption after reading from the database

I’ve been working with the LevelDB for a few weeks, coding some tools to access the database and parse the data to be human readable.

However, every single time I read from the chainstate the data gets corrupted (ask me to rebuild it when running bitcoind). I decided to copy the DB as a workaround after it happened the first time, but it’s quite annoying to do so every single time I want to update the data.

I’m using plyvel and Python 2.8, and I close the DB every time I finish with the reading.


# Open the LevelDB db = plyvel.DB(".bitcoin/chainstate")  for key, o_value in db:  # do stuff  # Close the LevelDB db.close() 

Does anyone knows what could be the reason? Does bitcoind prevent other software to access the DB by marking the last access somehow?

Recent Questions – Bitcoin Stack Exchange

How to create a Database on Blockchain and retrieve it after applying some operation and constraints on the data of tables?

I want to create a database on Blockchain which gets input from a HTML form and add a tuple to table on Blockchain on each submission.The Tuples on Blockchain will be sorted by applying some operations on it and constraints of visibility of data for certain period of time. I had tried almost all available on internet but no platform provides such functionality and i can’t find any relevant tutorials for the same.

Recent Questions – Bitcoin Stack Exchange