From eaf45d243b559f80a18ba2dc41ed7abed94e7748 Mon Sep 17 00:00:00 2001 From: Anna Shaleva Date: Tue, 20 Apr 2021 11:21:43 +0300 Subject: [PATCH] wallet: allow to sign with encrypted contract-based accounts --- pkg/wallet/account.go | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/pkg/wallet/account.go b/pkg/wallet/account.go index 66393f9ab..93f0c983f 100644 --- a/pkg/wallet/account.go +++ b/pkg/wallet/account.go @@ -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()