mirror of
https://github.com/ethereum/go-ethereum.git
synced 2026-07-15 17:30:44 +00:00
parent
e6f85271a3
commit
a75fa97f56
1 changed files with 3 additions and 4 deletions
|
|
@ -156,8 +156,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
|
||||||
|
|
@ -194,7 +193,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
|
||||||
|
|
@ -402,7 +401,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
|
||||||
|
|
|
||||||
Loading…
Reference in a new issue