forked from TrueCloudLab/neoneo-go
wallet: don't fail in SignTx when no contract provided
Unfortunately valid NEP-6 can have no contract inside of account, so this should be accounted for.
This commit is contained in:
parent
2f8896f7a1
commit
7a930a8e11
1 changed files with 3 additions and 0 deletions
|
@ -84,6 +84,9 @@ 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.Contract == nil {
|
||||
return errors.New("account has no contract")
|
||||
}
|
||||
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{})
|
||||
|
|
Loading…
Reference in a new issue