Add BlockHeader to HeightHash notification.
This commit is contained in:
parent
d5d8e0db7f
commit
90b641c86c
2 changed files with 9 additions and 3 deletions
7
db/db.go
7
db/db.go
|
@ -775,7 +775,12 @@ func (db *ReadOnlyDBColumnFamily) detectChanges(notifCh chan<- interface{}) erro
|
||||||
log.Info("error getting block hash: ", err)
|
log.Info("error getting block hash: ", err)
|
||||||
return err
|
return err
|
||||||
}
|
}
|
||||||
notifCh <- &internal.HeightHash{Height: uint64(height), BlockHash: hash}
|
header, err := db.GetHeader(height)
|
||||||
|
if err != nil {
|
||||||
|
log.Info("error getting block header: ", err)
|
||||||
|
return err
|
||||||
|
}
|
||||||
|
notifCh <- &internal.HeightHash{Height: uint64(height), BlockHash: hash, BlockHeader: header}
|
||||||
}
|
}
|
||||||
//TODO: ClearCache
|
//TODO: ClearCache
|
||||||
log.Warn("implement cache clearing")
|
log.Warn("implement cache clearing")
|
||||||
|
|
|
@ -4,6 +4,7 @@ package internal
|
||||||
|
|
||||||
// HeightHash struct for the height subscription endpoint.
|
// HeightHash struct for the height subscription endpoint.
|
||||||
type HeightHash struct {
|
type HeightHash struct {
|
||||||
Height uint64
|
Height uint64
|
||||||
BlockHash []byte
|
BlockHash []byte
|
||||||
|
BlockHeader []byte
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in a new issue