aboutsummaryrefslogtreecommitdiffstats
path: root/ethchain/state_transition.go
diff options
context:
space:
mode:
authorobscuren <geffobscura@gmail.com>2014-06-13 19:06:27 +0800
committerobscuren <geffobscura@gmail.com>2014-06-13 19:06:27 +0800
commitc734dde982c4ce778afa074e94efb09e552dbd84 (patch)
treee67fd1bbc2d359f3463112fa1b5c92e8da8f64f7 /ethchain/state_transition.go
parentcebf4e3697dcd20e290ff56ad6e5dfca2059c063 (diff)
downloaddexon-c734dde982c4ce778afa074e94efb09e552dbd84.tar
dexon-c734dde982c4ce778afa074e94efb09e552dbd84.tar.gz
dexon-c734dde982c4ce778afa074e94efb09e552dbd84.tar.bz2
dexon-c734dde982c4ce778afa074e94efb09e552dbd84.tar.lz
dexon-c734dde982c4ce778afa074e94efb09e552dbd84.tar.xz
dexon-c734dde982c4ce778afa074e94efb09e552dbd84.tar.zst
dexon-c734dde982c4ce778afa074e94efb09e552dbd84.zip
comments & refactor
Diffstat (limited to 'ethchain/state_transition.go')
-rw-r--r--ethchain/state_transition.go20
1 files changed, 16 insertions, 4 deletions
diff --git a/ethchain/state_transition.go b/ethchain/state_transition.go
index 6ec9205e9..1256d019c 100644
--- a/ethchain/state_transition.go
+++ b/ethchain/state_transition.go
@@ -6,6 +6,22 @@ import (
"math/big"
)
+/*
+ * The State transitioning model
+ *
+ * A state transition is a change made when a transaction is applied to the current world state
+ * The state transitioning model does all all the necessary work to work out a valid new state root.
+ * 1) Nonce handling
+ * 2) Pre pay / buy gas of the coinbase (miner)
+ * 3) Create a new state object if the recipient is \0*32
+ * 4) Value transfer
+ * == If contract creation ==
+ * 4a) Attempt to run transaction data
+ * 4b) If valid, use result as code for the new state object
+ * == end ==
+ * 5) Run Script section
+ * 6) Derive new state root
+ */
type StateTransition struct {
coinbase []byte
tx *Transaction
@@ -115,10 +131,6 @@ func (self *StateTransition) TransitionState() (err error) {
}
sender.Nonce += 1
- defer func() {
- // Notify all subscribers
- //self.Ethereum.Reactor().Post("newTx:post", tx)
- }()
if err = self.BuyGas(); err != nil {
return err