Open icook opened 10 years ago
It's also true that several other codebases need the concept of a chain database for handling reorg logic, so if properly abstracted it might belong well upstream.
Possibly the most battle tested one I know of: https://github.com/spesmilo/electrum/blob/11fc93dc4add165b9ad69aee24ab45e81be2859d/lib/blockchain.py
I'm sure there are others that ideas/bits could be used from to make something good enough for a lib.
Pulling out all the store/retrieve calls to their own datastore class would be helpful in testing.