Search in sources :

Example 1 with MutableTrie

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));
}
Also used : Keccak256(co.rsk.crypto.Keccak256) MutableTrie(co.rsk.trie.MutableTrie) Trie(co.rsk.trie.Trie)

Aggregations

Keccak256 (co.rsk.crypto.Keccak256)1 MutableTrie (co.rsk.trie.MutableTrie)1 Trie (co.rsk.trie.Trie)1