From dccf440dca07ef5327128e61cfdb2aa449f5d6f3 Mon Sep 17 00:00:00 2001 From: Roman Khimov Date: Fri, 29 Nov 2019 18:00:08 +0300 Subject: [PATCH] rpc: skip input/outputs mangling if no gas is attached to invocation --- pkg/rpc/rpc.go | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/pkg/rpc/rpc.go b/pkg/rpc/rpc.go index be9143085..d079142ef 100644 --- a/pkg/rpc/rpc.go +++ b/pkg/rpc/rpc.go @@ -167,8 +167,10 @@ func (c *Client) SignAndPushInvocationTx(script []byte, wif *keys.WIF, gas util. fromAddress := wif.PrivateKey.Address() - if err = AddInputsAndUnspentsToTx(tx, fromAddress, gasID, gas, c); err != nil { - return txHash, errors.Wrap(err, "failed to add inputs and unspents to transaction") + if gas > 0 { + if err = AddInputsAndUnspentsToTx(tx, fromAddress, gasID, gas, c); err != nil { + return txHash, errors.Wrap(err, "failed to add inputs and unspents to transaction") + } } if err = SignTx(tx, wif); err != nil {