wallet: allow pre-filled contract-based scripts in SignTx

They're allowed already for regular accounts (see below), but parameterless
accounts always add a script which is wrong.
This commit is contained in:
Roman Khimov 2022-08-06 17:45:46 +03:00
parent 8385efe4b3
commit f369c2a359

View file

@ -85,7 +85,9 @@ func NewAccount() (*Account, error) {
// SignTx signs transaction t and updates it's Witnesses. // SignTx signs transaction t and updates it's Witnesses.
func (a *Account) SignTx(net netmode.Magic, t *transaction.Transaction) error { func (a *Account) SignTx(net netmode.Magic, t *transaction.Transaction) error {
if len(a.Contract.Parameters) == 0 { if len(a.Contract.Parameters) == 0 {
if len(t.Signers) != len(t.Scripts) { // Sequential signing vs. existing scripts.
t.Scripts = append(t.Scripts, transaction.Witness{}) t.Scripts = append(t.Scripts, transaction.Witness{})
}
return nil return nil
} }
if a.privateKey == nil { if a.privateKey == nil {