From ae07c0171da905df0268d10c92e47dc07344c042 Mon Sep 17 00:00:00 2001 From: Ethan Buchman Date: Wed, 16 Mar 2016 19:45:46 -0400 Subject: [PATCH] light weight block event --- consensus/state.go | 2 +- types/events.go | 6 +++++- 2 files changed, 6 insertions(+), 2 deletions(-) diff --git a/consensus/state.go b/consensus/state.go index 6a0c54bf..a768a7a0 100644 --- a/consensus/state.go +++ b/consensus/state.go @@ -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() diff --git a/types/events.go b/types/events.go index 247b1e7b..02e6b072 100644 --- a/types/events.go +++ b/types/events.go @@ -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