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:
parent
8385efe4b3
commit
f369c2a359
1 changed files with 3 additions and 1 deletions
|
@ -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 {
|
||||||
t.Scripts = append(t.Scripts, transaction.Witness{})
|
if len(t.Signers) != len(t.Scripts) { // Sequential signing vs. existing scripts.
|
||||||
|
t.Scripts = append(t.Scripts, transaction.Witness{})
|
||||||
|
}
|
||||||
return nil
|
return nil
|
||||||
}
|
}
|
||||||
if a.privateKey == nil {
|
if a.privateKey == nil {
|
||||||
|
|
Loading…
Reference in a new issue