aboutsummaryrefslogtreecommitdiffstats
path: root/core
diff options
context:
space:
mode:
authorobscuren <geffobscura@gmail.com>2015-03-13 23:29:04 +0800
committerobscuren <geffobscura@gmail.com>2015-03-13 23:29:04 +0800
commitf1fcda4f2fe05e46e3d350cb89a52fd33df3767f (patch)
tree3e714df981ccdaedabad2ebb8f684c8889a1c544 /core
parentcda88ce31a45af001443c71fb16bdb2bbe1efbc7 (diff)
downloadgo-tangerine-f1fcda4f2fe05e46e3d350cb89a52fd33df3767f.tar.gz
go-tangerine-f1fcda4f2fe05e46e3d350cb89a52fd33df3767f.tar.zst
go-tangerine-f1fcda4f2fe05e46e3d350cb89a52fd33df3767f.zip
Implemented managed state
* Reimplemented nonce management for known accounts.
Diffstat (limited to 'core')
-rw-r--r--core/block_processor.go6
1 files changed, 2 insertions, 4 deletions
diff --git a/core/block_processor.go b/core/block_processor.go
index 9fe74ef0a..f421c3539 100644
--- a/core/block_processor.go
+++ b/core/block_processor.go
@@ -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
}