From 9b03f968b18634a1d5f3b9a874508783e57f93b4 Mon Sep 17 00:00:00 2001 From: Anna Shaleva Date: Mon, 10 Feb 2020 17:12:38 +0300 Subject: [PATCH] core: fixe FreeGasLimit constraint Lack of FreeGasLimit in privnet leads to gas limit exceeding in case of transactions with small amount of GAS to be used for invoke operation (< real cost of the transaction). Solution: Fixed constraint in case when FreeGasLimit == 0. So now we are able to perform transactions in privnet with FreeGasLimit = 0 for free. --- pkg/core/blockchain.go | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/pkg/core/blockchain.go b/pkg/core/blockchain.go index d9219c9f5..30fd0ee7d 100644 --- a/pkg/core/blockchain.go +++ b/pkg/core/blockchain.go @@ -547,7 +547,7 @@ func (bc *Blockchain) storeBlock(block *block.Block) error { v.SetCheckedHash(tx.VerificationHash().BytesBE()) v.LoadScript(t.Script) v.SetPriceGetter(getPrice) - if bc.config.FreeGasLimit >= 0 { + if bc.config.FreeGasLimit > 0 { v.SetGasLimit(bc.config.FreeGasLimit + t.Gas) }