Example #1
0
        private void Parse()
        {
            if (this.children != null)
            {
                return;
            }

            Resolve();

            LList list = this.parsed_rlp == null?RLP.DecodeLazyList(this.rlp) : this.parsed_rlp;

            if (list != null && list.Count == 2)
            {
                this.children = new object[2];
                TrieKey key = TrieKey.FromPacked(list.GetBytes(0));
                this.children[0] = key;
                if (key.IsTerminal)
                {
                    this.children[1] = list.GetBytes(1);
                }
                else
                {
                    this.children[1] = list.IsList(1) ? new TrieNode(this.reference, list.GetList(1)) : new TrieNode(this.reference, list.GetBytes(1));
                }
            }
            else
            {
                this.children   = new object[17];
                this.parsed_rlp = list;
            }
        }