event listeners take EventData, not interface{}; EventData type assertions

This commit is contained in:
Jae Kwon
2015-08-11 12:46:33 -07:00
parent b37ff75f7a
commit ffcc657be6
16 changed files with 62 additions and 73 deletions
+1 -1
View File
@@ -181,7 +181,7 @@ func (c *Crawler) readLoop(node *Node) {
}
func (c *Crawler) consumeMessage(eventMsg ctypes.ResultEvent, node *Node) error {
block := eventMsg.Data.(*types.Block)
block := eventMsg.Data.(*types.EventDataNewBlock).Block
node.LastSeen = time.Now()
node.BlockHeight = block.Height
node.BlockHistory[block.Height] = node.LastSeen