wallet: allow to sign with encrypted contract-based accounts

This commit is contained in:
Anna Shaleva 2021-04-20 11:21:43 +03:00
parent 881ed3065e
commit eaf45d243b

View file

@ -96,13 +96,13 @@ func NewAccount() (*Account, error) {
// SignTx signs transaction t and updates it's Witnesses.
func (a *Account) SignTx(net netmode.Magic, t *transaction.Transaction) error {
if a.privateKey == nil {
return errors.New("account is not unlocked")
}
if len(a.Contract.Parameters) == 0 {
t.Scripts = append(t.Scripts, transaction.Witness{})
return nil
}
if a.privateKey == nil {
return errors.New("account is not unlocked")
}
sign := a.privateKey.SignHashable(uint32(net), t)
verif := a.GetVerificationScript()