Fix getBlockHeader socket.io method
This commit is contained in:
parent
dc14eb58b6
commit
207351d4ec
@ -260,16 +260,9 @@ type resultGetBlockHeader struct {
|
|||||||
func (s *SocketIoServer) getBlockHeader(height uint32, hash string) (res resultGetBlockHeader, err error) {
|
func (s *SocketIoServer) getBlockHeader(height uint32, hash string) (res resultGetBlockHeader, err error) {
|
||||||
if hash == "" {
|
if hash == "" {
|
||||||
// trezor is interested only in hash
|
// trezor is interested only in hash
|
||||||
if height == 0 {
|
hash, err = s.db.GetBlockHash(height)
|
||||||
height, hash, err = s.db.GetBestBlock()
|
if err != nil {
|
||||||
if err != nil {
|
return
|
||||||
return
|
|
||||||
}
|
|
||||||
} else {
|
|
||||||
hash, err = s.db.GetBlockHash(height)
|
|
||||||
if err != nil {
|
|
||||||
return
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
res.Result.Hash = hash
|
res.Result.Hash = hash
|
||||||
return
|
return
|
||||||
|
|||||||
Loading…
Reference in New Issue
Block a user