Implemented managed state

* Reimplemented nonce management for known accounts.
This commit is contained in:
obscuren
2015-03-13 16:29:04 +01:00
parent cda88ce31a
commit f1fcda4f2f
4 changed files with 90 additions and 24 deletions

View File

@ -79,12 +79,10 @@ func (self *BlockProcessor) ApplyTransaction(coinbase *state.StateObject, stated
statedb.EmptyLogs()
cb := statedb.GetStateObject(coinbase.Address())
/*
st := NewStateTransition(NewEnv(statedb, self.bc, tx, block), tx, cb)
_, err := st.TransitionState()
*/
_, gas, err := ApplyMessage(NewEnv(statedb, self.bc, tx, block), tx, cb)
if err != nil && (IsNonceErr(err) || state.IsGasLimitErr(err) || IsInvalidTxErr(err)) {
// If the account is managed, remove the invalid nonce.
self.bc.TxState().RemoveNonce(tx.From(), tx.Nonce())
return nil, nil, err
}