rpc: skip input/outputs mangling if no gas is attached to invocation

This commit is contained in:
Roman Khimov 2019-11-29 18:00:08 +03:00
parent 8a5ac12df8
commit dccf440dca

View file

@ -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 {