lbryio / lbrycrd

The blockchain that provides the digital content namespace for the LBRY protocol
https://lbry.com
MIT License
2.57k stars 178 forks source link

Disk related functions should be seperated out from ClaimTrie class into its own class #136

Closed kaykurokawa closed 6 years ago

kaykurokawa commented 6 years ago

All disk read/write functions done through the CDBWrapper class in ClaimTrie should be separated out onto its own file/class. This should improve readability as it should be much clearer what is being saved and how. We should also write unit tests for the separated out disk read/write class.

bvbfan commented 6 years ago

I will try to make the task. You mean CDBWrapper (reads from disk) as well as CDBBatch (write to disk) to separated in related class, right?

kaykurokawa commented 6 years ago

Yes basically anything that has to do with CClaimTrie.db in claimtrie.h/cpp

bvbfan commented 6 years ago

I found that architecture is not good enough to me. Did you accept more agressive refactor? Why, CClaimTrieCache should have all dirty nodes and CClaimTrie should search in, when it's not found, then query CClaimTrieDb (new separed class) so CClaimTrie became a interface between cache and db. This will result in remove of all dirtyQueueXXX and related functions from CClaimTrie. Is this acceptable to you?

bvbfan commented 6 years ago

https://github.com/lbryio/lbrycrd/pull/140 It's simple, i can make more aggressive refactor if still needs

lyoshenka commented 6 years ago

handled by #175

alyssaoc commented 6 years ago

closing for #175