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

Signed-off-by: Pavel Karpy <carpawell@nspcc.ru>
remotes/fyrchik/regions
Pavel Karpy 2022-09-01 19:42:08 +03:00 committed by fyrchik
parent 1e57565f6c
commit 60aa53651b
1 changed files with 6 additions and 1 deletions

View File

@ -129,7 +129,12 @@ func (c *initializeContext) multiSign(tx *transaction.Transaction, accType strin
if err != nil {
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
}