native: don't distribute gas at block 0

It fails at the moment and it doesn't make sense at conceptual level.
This commit is contained in:
Roman Khimov 2020-04-23 16:25:30 +03:00
parent 30836ca69b
commit 1dcace1594

View file

@ -125,7 +125,7 @@ func (n *NEO) increaseBalance(ic *interop.Context, acc *state.Account, amount *b
} }
func (n *NEO) distributeGas(ic *interop.Context, acc *state.Account) error { func (n *NEO) distributeGas(ic *interop.Context, acc *state.Account) error {
if ic.Block == nil { if ic.Block == nil || ic.Block.Index == 0 {
return nil return nil
} }
sys, net, err := ic.Chain.CalculateClaimable(util.Fixed8(acc.NEO.Balance.Int64()), acc.NEO.BalanceHeight, ic.Block.Index) sys, net, err := ic.Chain.CalculateClaimable(util.Fixed8(acc.NEO.Balance.Int64()), acc.NEO.BalanceHeight, ic.Block.Index)