[#1749] neofs-adm: Delete NNS records before updating

In case we already have the record and it is invalid, we should
overwrite it instead of having several conflicting records.

Signed-off-by: Evgenii Stratonikov <evgeniy@morphbits.ru>
This commit is contained in:
Evgenii Stratonikov 2022-09-05 12:54:24 +03:00 committed by fyrchik
parent 0818d8d43a
commit fe0c6db67d
3 changed files with 5 additions and 2 deletions

View file

@ -273,6 +273,7 @@ func (c *initializeContext) updateContracts() error {
}
if !ok {
w.WriteBytes(script)
emit.AppCall(w.BinWriter, nnsHash, "deleteRecords", callflag.All, domain, int64(nns.TXT))
emit.AppCall(w.BinWriter, nnsHash, "addRecord", callflag.All,
domain, int64(nns.TXT), cs.Hash.StringLE())
}