mirror of
https://github.com/nspcc-dev/neo-go.git
synced 2025-05-05 13:06:20 +00:00
core: restrict GAS available for invocation transactions
There are 10 GAS available for free plus any amount of GAS attached to a transaction.
This commit is contained in:
parent
d72d978a19
commit
4eae55143f
3 changed files with 236 additions and 1 deletions
|
@ -514,6 +514,11 @@ func (bc *Blockchain) storeBlock(block *block.Block) error {
|
|||
v := bc.spawnVMWithInterops(systemInterop)
|
||||
v.SetCheckedHash(tx.VerificationHash().BytesBE())
|
||||
v.LoadScript(t.Script)
|
||||
v.SetPriceGetter(getPrice)
|
||||
|
||||
gasAmount := util.Fixed8FromInt64(10) + t.Gas
|
||||
v.SetGasLimit(gasAmount)
|
||||
|
||||
err := v.Run()
|
||||
if !v.HasFailed() {
|
||||
_, err := systemInterop.dao.Persist()
|
||||
|
@ -554,7 +559,7 @@ func (bc *Blockchain) storeBlock(block *block.Block) error {
|
|||
TxHash: tx.Hash(),
|
||||
Trigger: trigger.Application,
|
||||
VMState: v.State(),
|
||||
GasConsumed: util.Fixed8(0),
|
||||
GasConsumed: v.GasConsumed(),
|
||||
Stack: v.Stack("estack"),
|
||||
Events: systemInterop.notifications,
|
||||
}
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue