Merge remote-tracking branch 'origin/consensus_refactor' into consensus_refactor_jae

This commit is contained in:
Jae Kwon
2015-12-14 09:33:11 -08:00
12 changed files with 650 additions and 754 deletions

View File

@ -62,8 +62,12 @@ func (b *Block) ValidateBasic(chainID string, lastBlockHeight int, lastBlockHash
}
func (b *Block) FillHeader() {
b.LastValidationHash = b.LastValidation.Hash()
b.DataHash = b.Data.Hash()
if b.LastValidationHash == nil {
b.LastValidationHash = b.LastValidation.Hash()
}
if b.DataHash == nil {
b.DataHash = b.Data.Hash()
}
}
// Computes and returns the block hash.

View File

@ -1,8 +1,6 @@
package types
import (
"time"
"github.com/tendermint/go-wire"
)
@ -17,6 +15,7 @@ func EventStringFork() string { return "Fork" }
func EventStringNewBlock() string { return "NewBlock" }
func EventStringNewRound() string { return "NewRound" }
func EventStringNewRoundStep() string { return "NewRoundStep" }
func EventStringTimeoutPropose() string { return "TimeoutPropose" }
func EventStringCompleteProposal() string { return "CompleteProposal" }
func EventStringPolka() string { return "Polka" }
@ -72,21 +71,21 @@ type EventDataApp struct {
Data []byte `json:"bytes"`
}
// We fire the most recent round state that led to the event
// (ie. NewRound will have the previous rounds state)
type EventDataRoundState struct {
CurrentTime time.Time `json:"current_time"`
Height int `json:"height"`
Round int `json:"round"`
Step string `json:"step"`
Height int `json:"height"`
Round int `json:"round"`
Step string `json:"step"`
StartTime time.Time `json:"start_time"`
CommitTime time.Time `json:"commit_time"`
Proposal *Proposal `json:"proposal"`
ProposalBlock *Block `json:"proposal_block"`
LockedRound int `json:"locked_round"`
LockedBlock *Block `json:"locked_block"`
POLRound int `json:"pol_round"`
// private, not exposed to websockets
rs interface{}
}
func (edrs *EventDataRoundState) RoundState() interface{} {
return edrs.rs
}
func (edrs *EventDataRoundState) SetRoundState(rs interface{}) {
edrs.rs = rs
}
type EventDataVote struct {