forked from TrueCloudLab/neoneo-go
wallet: check for t.GetSignedPart() result correctness
It can return nil easily and signing that is a big mistake.
This commit is contained in:
parent
943d435cd2
commit
3db14b4699
1 changed files with 3 additions and 0 deletions
|
@ -132,6 +132,9 @@ func (a *Account) SignTx(t *transaction.Transaction) error {
|
|||
return errors.New("account is not unlocked")
|
||||
}
|
||||
data := t.GetSignedPart()
|
||||
if data == nil {
|
||||
return errors.New("failed to get transaction's signed part")
|
||||
}
|
||||
sign := a.privateKey.Sign(data)
|
||||
|
||||
t.Scripts = append(t.Scripts, transaction.Witness{
|
||||
|
|
Loading…
Reference in a new issue