use of org.aion.rlp.Value in project aion by aionnetwork.
the class TrieImpl method getNode.
/**
* Helper method to retrieve the actual node. If the node is not a list and
* length is > 32 bytes get the actual node from the db.
*/
private Value getNode(Object node) {
Value val = new Value(node);
// so no need to encode it
if (!val.isBytes()) {
return val;
}
byte[] keyBytes = val.asBytes();
if (keyBytes.length == 0) {
return val;
} else if (keyBytes.length < 32) {
return new Value(keyBytes);
}
return this.cache.get(keyBytes);
}
Aggregations