cli/wallet: save tx only if --out
was provided
Also don't print tx hash twice.
This commit is contained in:
parent
0a596e1df2
commit
d50a14359a
1 changed files with 5 additions and 3 deletions
|
@ -59,14 +59,16 @@ func signMultisig(ctx *cli.Context) error {
|
||||||
if !ok {
|
if !ok {
|
||||||
return cli.NewExitError("verifiable item is not a transaction", 1)
|
return cli.NewExitError("verifiable item is not a transaction", 1)
|
||||||
}
|
}
|
||||||
fmt.Fprintln(ctx.App.Writer, tx.Hash().StringLE())
|
|
||||||
|
|
||||||
priv := acc.PrivateKey()
|
priv := acc.PrivateKey()
|
||||||
sign := priv.Sign(tx.GetSignedPart())
|
sign := priv.Sign(tx.GetSignedPart())
|
||||||
if err := c.AddSignature(acc.Contract, priv.PublicKey(), sign); err != nil {
|
if err := c.AddSignature(acc.Contract, priv.PublicKey(), sign); err != nil {
|
||||||
return cli.NewExitError(fmt.Errorf("can't add signature: %w", err), 1)
|
return cli.NewExitError(fmt.Errorf("can't add signature: %w", err), 1)
|
||||||
} else if err := writeParameterContext(c, ctx.String("out")); err != nil {
|
}
|
||||||
return cli.NewExitError(err, 1)
|
if out := ctx.String("out"); out != "" {
|
||||||
|
if err := writeParameterContext(c, out); err != nil {
|
||||||
|
return cli.NewExitError(err, 1)
|
||||||
|
}
|
||||||
}
|
}
|
||||||
if len(ctx.String(options.RPCEndpointFlag)) != 0 {
|
if len(ctx.String(options.RPCEndpointFlag)) != 0 {
|
||||||
w, err := c.GetWitness(acc.Contract)
|
w, err := c.GetWitness(acc.Contract)
|
||||||
|
|
Loading…
Reference in a new issue