[#1711] adm: Append witnesses only if they are missing

Signed-off-by: Pavel Karpy <carpawell@nspcc.ru>
This commit is contained in:
Pavel Karpy 2022-09-01 19:42:08 +03:00 committed by fyrchik
parent 1e57565f6c
commit 60aa53651b

View file

@ -129,7 +129,12 @@ func (c *initializeContext) multiSign(tx *transaction.Transaction, accType strin
if err != nil { if err != nil {
return fmt.Errorf("incomplete signature: %w", err) return fmt.Errorf("incomplete signature: %w", err)
} }
tx.Scripts = append(tx.Scripts, *w)
if len(tx.Scripts) == 0 {
tx.Scripts = append(tx.Scripts, *w)
} else {
tx.Scripts[0] = *w
}
return nil return nil
} }