native: fix netfee gas redistribution

Preview2 testnet:
file BlockStorage_100000/dump-block-12000.json: block 11562: key mismatch: feffffff1454a6cb279fbcedc66162ad4ad5d1d910202b92743e000000000000000000000005 vs feffffff1431b7e7aea5131f74721e002c6a56b610885813f79e000000000000000000000005

Originally this code was written to run after transactions processing, but
after 0fa4c49735 it works in different manner.
This commit is contained in:
Roman Khimov 2020-06-23 18:40:28 +03:00
parent d0331bf21b
commit 37d44b94e1

View file

@ -87,7 +87,7 @@ func (g *GAS) OnPersist(ic *interop.Context) error {
absAmount := big.NewInt(int64(tx.SystemFee + tx.NetworkFee)) absAmount := big.NewInt(int64(tx.SystemFee + tx.NetworkFee))
g.burn(ic, tx.Sender, absAmount) g.burn(ic, tx.Sender, absAmount)
} }
validators, err := g.NEO.GetValidatorsInternal(ic.Chain, ic.DAO) validators, err := g.NEO.GetNextBlockValidatorsInternal(ic.Chain, ic.DAO)
if err != nil { if err != nil {
return fmt.Errorf("cannot get block validators: %v", err) return fmt.Errorf("cannot get block validators: %v", err)
} }