-
Notifications
You must be signed in to change notification settings - Fork 199
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Fix maxTrieLevelInMemory invalid value #1757
Fix maxTrieLevelInMemory invalid value #1757
Conversation
data/trie/patriciaMerkleTrie.go
Outdated
@@ -514,7 +517,9 @@ func (tr *patriciaMerkleTrie) GetSerializedNodes(rootHash []byte, maxBuffToSend | |||
|
|||
// GetAllLeaves iterates the trie and returns a map that contains all leafNodes information | |||
func (tr *patriciaMerkleTrie) GetAllLeaves() (map[string][]byte, error) { | |||
//TODO: save those leafs into a levelDB struct (cache and storage) and at processing time to get from that structure. | |||
tr.mutOperation.Lock() |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
RLock / RUnlock ?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Done.
…0-fix-maxTrieLevelInMemory-on-sync
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
System tests passed.
Added missing mutex to GetAllLeaves() from trie.
Initialize maxTrieLevelInMemory in all the places in which maxTrieLevelInMemory=0
Return error if maxTrieLevelInMemory is initialized with 0.