public IHashTrieNode?GetNodeById(ulong id) { var prefix = EntryPrefix.PersistentHashMap.BuildPrefix(id); var content = Get(prefix); if (content is null) { return(null); } return(NodeSerializer.FromBytes(content)); }
public bool TryGetNode(ulong id, out IHashTrieNode?trieNode) { if (_nodeCache.TryGetValue(id, out trieNode)) { return(true); } var rawNode = _dbContext.Get(EntryPrefix.PersistentHashMap.BuildPrefix(id)); trieNode = null; if (rawNode == null) { return(false); } trieNode = NodeSerializer.FromBytes(rawNode); return(true); }