diff --git a/contracts/container/contract.go b/contracts/container/contract.go index 5cd1ace5..178225ca 100644 --- a/contracts/container/contract.go +++ b/contracts/container/contract.go @@ -1028,6 +1028,10 @@ func removeContainer(ctx storage.Context, id []byte, owner []byte) { containerListKey = append(containerListKey, id...) storage.Delete(ctx, containerListKey) + deleteByPrefix(ctx, append([]byte{nodesPrefix}, id...)) + deleteByPrefix(ctx, append([]byte{nextEpochNodesPrefix}, id...)) + deleteByPrefix(ctx, append([]byte{replicasNumberPrefix}, id...)) + storage.Delete(ctx, append([]byte{containerKeyPrefix}, id...)) storage.Delete(ctx, append([]byte{containersWithMetaPrefix}, id...)) storage.Delete(ctx, append(eACLPrefix, id...)) @@ -1168,3 +1172,10 @@ func cleanupContainers(ctx storage.Context, epoch int) { } } } + +func deleteByPrefix(ctx storage.Context, prefix []byte) { + it := storage.Find(ctx, prefix, storage.KeysOnly) + for iterator.Next(it) { + storage.Delete(ctx, iterator.Value(it).([]byte)) + } +} diff --git a/contracts/container/contract.nef b/contracts/container/contract.nef index a6eca852..4ea96d72 100755 Binary files a/contracts/container/contract.nef and b/contracts/container/contract.nef differ