use of co.rsk.trie.MutableTrie in project rskj by rsksmart.
the class RepositoryLocator method mutableTrieSnapshotAt.
private Optional<MutableTrie> mutableTrieSnapshotAt(BlockHeader header) {
Keccak256 stateRoot = stateRootHandler.translate(header);
if (EMPTY_HASH.equals(stateRoot)) {
return Optional.of(new MutableTrieImpl(trieStore, new Trie(trieStore)));
}
Optional<Trie> trie = trieStore.retrieve(stateRoot.getBytes());
return trie.map(t -> new MutableTrieImpl(trieStore, t));
}
Aggregations