|
|
@ -155,8 +155,7 @@ func (s *Sync) AddSubTrie(root common.Hash, path []byte, parent common.Hash, cal |
|
|
|
} |
|
|
|
} |
|
|
|
// If database says this is a duplicate, then at least the trie node is
|
|
|
|
// If database says this is a duplicate, then at least the trie node is
|
|
|
|
// present, and we hold the assumption that it's NOT legacy contract code.
|
|
|
|
// present, and we hold the assumption that it's NOT legacy contract code.
|
|
|
|
blob := rawdb.ReadTrieNode(s.database, root) |
|
|
|
if rawdb.HasTrieNode(s.database, root) { |
|
|
|
if len(blob) > 0 { |
|
|
|
|
|
|
|
return |
|
|
|
return |
|
|
|
} |
|
|
|
} |
|
|
|
// Assemble the new sub-trie sync request
|
|
|
|
// Assemble the new sub-trie sync request
|
|
|
@ -193,7 +192,7 @@ func (s *Sync) AddCodeEntry(hash common.Hash, path []byte, parent common.Hash) { |
|
|
|
// sync is expected to run with a fresh new node. Even there
|
|
|
|
// sync is expected to run with a fresh new node. Even there
|
|
|
|
// exists the code with legacy format, fetch and store with
|
|
|
|
// exists the code with legacy format, fetch and store with
|
|
|
|
// new scheme anyway.
|
|
|
|
// new scheme anyway.
|
|
|
|
if blob := rawdb.ReadCodeWithPrefix(s.database, hash); len(blob) > 0 { |
|
|
|
if rawdb.HasCodeWithPrefix(s.database, hash) { |
|
|
|
return |
|
|
|
return |
|
|
|
} |
|
|
|
} |
|
|
|
// Assemble the new sub-trie sync request
|
|
|
|
// Assemble the new sub-trie sync request
|
|
|
@ -401,7 +400,7 @@ func (s *Sync) children(req *request, object node) ([]*request, error) { |
|
|
|
} |
|
|
|
} |
|
|
|
// If database says duplicate, then at least the trie node is present
|
|
|
|
// If database says duplicate, then at least the trie node is present
|
|
|
|
// and we hold the assumption that it's NOT legacy contract code.
|
|
|
|
// and we hold the assumption that it's NOT legacy contract code.
|
|
|
|
if blob := rawdb.ReadTrieNode(s.database, hash); len(blob) > 0 { |
|
|
|
if rawdb.HasTrieNode(s.database, hash) { |
|
|
|
continue |
|
|
|
continue |
|
|
|
} |
|
|
|
} |
|
|
|
// Locally unknown node, schedule for retrieval
|
|
|
|
// Locally unknown node, schedule for retrieval
|
|
|
|