diff options
author | Lewis Marshall <lewis@lmars.net> | 2017-05-22 14:57:03 +0800 |
---|---|---|
committer | Jeffrey Wilcke <jeffrey@ethereum.org> | 2017-05-22 14:57:03 +0800 |
commit | 2a41e76b39f8279400e42f3e0dc45f55457e2cff (patch) | |
tree | 2d0e34836a3280357d1c375bd761159417a6efa7 /swarm/api/manifest.go | |
parent | 4a2c17b1ab8316ab3b4fa2b769d1dccad3cb97d5 (diff) | |
download | dexon-2a41e76b39f8279400e42f3e0dc45f55457e2cff.tar dexon-2a41e76b39f8279400e42f3e0dc45f55457e2cff.tar.gz dexon-2a41e76b39f8279400e42f3e0dc45f55457e2cff.tar.bz2 dexon-2a41e76b39f8279400e42f3e0dc45f55457e2cff.tar.lz dexon-2a41e76b39f8279400e42f3e0dc45f55457e2cff.tar.xz dexon-2a41e76b39f8279400e42f3e0dc45f55457e2cff.tar.zst dexon-2a41e76b39f8279400e42f3e0dc45f55457e2cff.zip |
swarm/api: Fix adding paths which exist as manifests (#14482)
Signed-off-by: Lewis Marshall <lewis@lmars.net>
Diffstat (limited to 'swarm/api/manifest.go')
-rw-r--r-- | swarm/api/manifest.go | 4 |
1 files changed, 2 insertions, 2 deletions
diff --git a/swarm/api/manifest.go b/swarm/api/manifest.go index dbaaf4bff..e251620a7 100644 --- a/swarm/api/manifest.go +++ b/swarm/api/manifest.go @@ -237,12 +237,12 @@ func (self *manifestTrie) addEntry(entry *manifestTrieEntry, quitC chan bool) { } b := byte(entry.Path[0]) - if (self.entries[b] == nil) || (self.entries[b].Path == entry.Path) { + oldentry := self.entries[b] + if (oldentry == nil) || (oldentry.Path == entry.Path && oldentry.ContentType != ManifestType) { self.entries[b] = entry return } - oldentry := self.entries[b] cpl := 0 for (len(entry.Path) > cpl) && (len(oldentry.Path) > cpl) && (entry.Path[cpl] == oldentry.Path[cpl]) { cpl++ |