native: optimize GAS onPersist for empty blocks
There is no need to get a list of validators when there are no transactions in the block.
This commit is contained in:
parent
f0fbb2d8ff
commit
dd6895b103
1 changed files with 3 additions and 0 deletions
|
@ -80,6 +80,9 @@ func (g *GAS) Initialize(ic *interop.Context) error {
|
|||
|
||||
// OnPersist implements Contract interface.
|
||||
func (g *GAS) OnPersist(ic *interop.Context) error {
|
||||
if len(ic.Block.Transactions) == 0 {
|
||||
return nil
|
||||
}
|
||||
for _, tx := range ic.Block.Transactions {
|
||||
absAmount := big.NewInt(int64(tx.SystemFee + tx.NetworkFee))
|
||||
g.burn(ic, tx.Sender, absAmount)
|
||||
|
|
Loading…
Reference in a new issue