Use only index lookup in getBlockHeader, trezor needs only tx hash
parent
12876290e4
commit
92aa4f0c7f
|
@ -256,6 +256,7 @@ 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 only interested in hash
|
||||||
if height == 0 {
|
if height == 0 {
|
||||||
height, hash, err = s.db.GetBestBlock()
|
height, hash, err = s.db.GetBestBlock()
|
||||||
if err != nil {
|
if err != nil {
|
||||||
|
@ -267,6 +268,8 @@ func (s *SocketIoServer) getBlockHeader(height uint32, hash string) (res resultG
|
||||||
return
|
return
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
res.Result.Hash = hash
|
||||||
|
return
|
||||||
}
|
}
|
||||||
bh, err := s.chain.GetBlockHeader(hash)
|
bh, err := s.chain.GetBlockHeader(hash)
|
||||||
if err != nil {
|
if err != nil {
|
||||||
|
|
Loading…
Reference in New Issue