aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorobscuren <geffobscura@gmail.com>2014-12-04 23:44:14 +0800
committerobscuren <geffobscura@gmail.com>2014-12-04 23:44:14 +0800
commit8c7e4b290fbdfe2c0da451aef03b94bec3c95e4c (patch)
tree85bb3c01cfc79cec376be244585683349214c047
parent565389815040d518529b973d4a6fc38c08e43e5a (diff)
downloaddexon-8c7e4b290fbdfe2c0da451aef03b94bec3c95e4c.tar
dexon-8c7e4b290fbdfe2c0da451aef03b94bec3c95e4c.tar.gz
dexon-8c7e4b290fbdfe2c0da451aef03b94bec3c95e4c.tar.bz2
dexon-8c7e4b290fbdfe2c0da451aef03b94bec3c95e4c.tar.lz
dexon-8c7e4b290fbdfe2c0da451aef03b94bec3c95e4c.tar.xz
dexon-8c7e4b290fbdfe2c0da451aef03b94bec3c95e4c.tar.zst
dexon-8c7e4b290fbdfe2c0da451aef03b94bec3c95e4c.zip
Added pre processing of transaction on the transient state
-rw-r--r--xeth/pipe.go8
1 files changed, 7 insertions, 1 deletions
diff --git a/xeth/pipe.go b/xeth/pipe.go
index 6da92cd23..2ca8134ce 100644
--- a/xeth/pipe.go
+++ b/xeth/pipe.go
@@ -136,11 +136,17 @@ func (self *XEth) Transact(key *crypto.KeyPair, to []byte, value, gas, price *et
tx.Nonce = nonce
tx.Sign(key.PrivateKey)
+
+ // Do some pre processing for our "pre" events and hooks
+ block := self.blockChain.NewBlock(key.Address())
+ coinbase := state.GetStateObject(key.Address())
+ coinbase.SetGasPool(block.GasLimit)
+ self.blockManager.ApplyTransactions(coinbase, state, block, types.Transactions{tx}, true)
+
err := self.obj.TxPool().Add(tx)
if err != nil {
return nil, err
}
-
state.SetNonce(key.Address(), nonce+1)
if contractCreation {