@@ -1418,7 +1418,7 @@ func (bc *Blockchain) storeBlock(block *block.Block, txpool *mempool.Pool) error
1418
1418
cache = bc .dao .GetPrivate ()
1419
1419
aerCache = bc .dao .GetPrivate ()
1420
1420
appExecResults = make ([]* state.AppExecResult , 0 , 2 + len (block .Transactions ))
1421
- txesConsumed = make (map [util. Uint256 ]int64 , len (block .Transactions ))
1421
+ txesConsumed = make ([ ]int64 , len (block .Transactions ))
1422
1422
aerchan = make (chan * state.AppExecResult , len (block .Transactions )/ 8 ) // Tested 8 and 4 with no practical difference, but feel free to test more and tune.
1423
1423
aerdone = make (chan error )
1424
1424
)
@@ -1511,7 +1511,7 @@ func (bc *Blockchain) storeBlock(block *block.Block, txpool *mempool.Pool) error
1511
1511
appExecResults = append (appExecResults , aer )
1512
1512
aerchan <- aer
1513
1513
1514
- for _ , tx := range block .Transactions {
1514
+ for i , tx := range block .Transactions {
1515
1515
systemInterop := bc .newInteropContext (trigger .Application , cache , block , tx )
1516
1516
systemInterop .ReuseVM (v )
1517
1517
v .LoadScriptWithFlags (tx .Script , callflag .All )
@@ -1534,7 +1534,7 @@ func (bc *Blockchain) storeBlock(block *block.Block, txpool *mempool.Pool) error
1534
1534
zap .Error (err ))
1535
1535
faultException = err .Error ()
1536
1536
}
1537
- txesConsumed [tx . Hash () ] = v .GasConsumed ()
1537
+ txesConsumed [i ] = v .GasConsumed ()
1538
1538
aer := & state.AppExecResult {
1539
1539
Container : tx .Hash (),
1540
1540
Execution : state.Execution {
@@ -1685,7 +1685,7 @@ func (bc *Blockchain) IsExtensibleAllowed(u util.Uint160) bool {
1685
1685
return n < len (us )
1686
1686
}
1687
1687
1688
- func (bc * Blockchain ) runPersist (script []byte , block * block.Block , cache * dao.Simple , trig trigger.Type , v * vm.VM , txesConsumed map [util. Uint256 ]int64 ) (* state.AppExecResult , * vm.VM , error ) {
1688
+ func (bc * Blockchain ) runPersist (script []byte , block * block.Block , cache * dao.Simple , trig trigger.Type , v * vm.VM , txesConsumed [ ]int64 ) (* state.AppExecResult , * vm.VM , error ) {
1689
1689
systemInterop := bc .newInteropContext (trig , cache , block , nil )
1690
1690
if v == nil {
1691
1691
v = systemInterop .SpawnVM ()
0 commit comments