Make order be decided first; Remove TMSP Commit/Rollback

This commit is contained in:
Jae Kwon
2016-01-06 17:14:20 -08:00
committed by Jae Kwon
parent 792759c414
commit 3e3c0083c7
17 changed files with 388 additions and 514 deletions

View File

@ -9,7 +9,6 @@ import (
. "github.com/tendermint/go-common"
dbm "github.com/tendermint/go-db"
"github.com/tendermint/go-wire"
"github.com/tendermint/tendermint/events"
"github.com/tendermint/tendermint/types"
)
@ -25,15 +24,13 @@ type State struct {
db dbm.DB
GenesisDoc *types.GenesisDoc
ChainID string
LastBlockHeight int
LastBlockHeight int // Genesis state has this set to 0. So, Block(H=0) does not exist.
LastBlockHash []byte
LastBlockParts types.PartSetHeader
LastBlockTime time.Time
Validators *types.ValidatorSet
LastValidators *types.ValidatorSet
LastAppHash []byte
evc *events.EventCache
AppHash []byte
}
func LoadState(db dbm.DB) *State {
@ -64,8 +61,7 @@ func (s *State) Copy() *State {
LastBlockTime: s.LastBlockTime,
Validators: s.Validators.Copy(),
LastValidators: s.LastValidators.Copy(),
LastAppHash: s.LastAppHash,
evc: nil,
AppHash: s.AppHash,
}
}
@ -81,13 +77,6 @@ func (s *State) Save() {
s.db.Set(stateKey, buf.Bytes())
}
func (s *State) SetEventCache(evc *events.EventCache) {
s.mtx.Lock()
defer s.mtx.Unlock()
s.evc = evc
}
//-----------------------------------------------------------------------------
// Genesis
@ -133,6 +122,6 @@ func MakeGenesisState(db dbm.DB, genDoc *types.GenesisDoc) *State {
LastBlockTime: genDoc.GenesisTime,
Validators: types.NewValidatorSet(validators),
LastValidators: types.NewValidatorSet(nil),
LastAppHash: genDoc.AppHash,
AppHash: genDoc.AppHash,
}
}