Return hashes with getlatestblock
This commit is contained in:
parent
7f81fcbf78
commit
1b485256a3
|
@ -80,6 +80,7 @@ type (
|
||||||
Chain string
|
Chain string
|
||||||
Upgrades map[string]Upgradeinfo
|
Upgrades map[string]Upgradeinfo
|
||||||
Blocks int
|
Blocks int
|
||||||
|
BestBlockHash string
|
||||||
Consensus ConsensusInfo
|
Consensus ConsensusInfo
|
||||||
EstimatedHeight int
|
EstimatedHeight int
|
||||||
}
|
}
|
||||||
|
|
|
@ -146,13 +146,16 @@ func (s *lwdStreamer) GetLatestBlock(ctx context.Context, placeholder *walletrpc
|
||||||
var getblockchaininfoReply common.ZcashdRpcReplyGetblockchaininfo
|
var getblockchaininfoReply common.ZcashdRpcReplyGetblockchaininfo
|
||||||
err := json.Unmarshal(result, &getblockchaininfoReply)
|
err := json.Unmarshal(result, &getblockchaininfoReply)
|
||||||
if err != nil {
|
if err != nil {
|
||||||
return nil, rpcErr
|
return nil, err
|
||||||
|
}
|
||||||
|
|
||||||
|
hash, err := hex.DecodeString(getblockchaininfoReply.BestBlockHash)
|
||||||
|
if err != nil {
|
||||||
|
return nil, err
|
||||||
}
|
}
|
||||||
|
|
||||||
common.Metrics.LatestBlockCounter.Inc()
|
common.Metrics.LatestBlockCounter.Inc()
|
||||||
|
return &walletrpc.BlockID{Height: uint64(getblockchaininfoReply.Blocks), Hash: parser.Reverse(hash)}, nil
|
||||||
// TODO: also return block hashes here
|
|
||||||
return &walletrpc.BlockID{Height: uint64(getblockchaininfoReply.Blocks)}, nil
|
|
||||||
}
|
}
|
||||||
|
|
||||||
// GetTaddressTxids is a streaming RPC that returns transaction IDs that have
|
// GetTaddressTxids is a streaming RPC that returns transaction IDs that have
|
||||||
|
|
Loading…
Reference in New Issue