Browse Source

light weight block event

pull/205/head
Ethan Buchman 9 years ago
parent
commit
ae07c0171d
2 changed files with 6 additions and 2 deletions
  1. +1
    -1
      consensus/state.go
  2. +5
    -1
      types/events.go

+ 1
- 1
consensus/state.go View File

@ -1205,7 +1205,7 @@ func (cs *ConsensusState) finalizeCommit(height int) {
// Fire off event for new block.
// TODO: Handle app failure. See #177
cs.evsw.FireEvent(types.EventStringNewBlock(), types.EventDataNewBlock{block})
cs.evsw.FireEvent(types.EventStringNewBlock(), types.EventDataNewBlock{&types.BlockHeader{block.Header}})
// Create a copy of the state for staging
stateCopy := cs.state.Copy()


+ 5
- 1
types/events.go View File

@ -57,7 +57,11 @@ var _ = wire.RegisterInterface(
// but some (an input to a call tx or a receive) are more exotic
type EventDataNewBlock struct {
Block *Block `json:"block"`
// we drop block data but keep the form the same
Block *BlockHeader `json:"block"`
}
type BlockHeader struct {
Header *Header `json:"header"`
}
// All txs fire EventDataTx


Loading…
Cancel
Save